Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将值发送到下一页不工作_Php_Html - Fatal编程技术网

Php 将值发送到下一页不工作

Php 将值发送到下一页不工作,php,html,Php,Html,你好 我有一个表单,其中我有名字和姓氏,但我只在下一页的相同字段中发送名字值,如下面的代码 <label>Owned By:</label> <br /> <input class="input" type="text" name="ownerPrint" readonly value="<?php echo (isset($_GET['first_name'])) ? htmlent

你好

我有一个表单,其中我有名字和姓氏,但我只在下一页的相同字段中发送名字值,如下面的代码

<label>Owned By:</label>
                <br />
                <input class="input" type="text" name="ownerPrint" readonly value="<?php echo (isset($_GET['first_name'])) ? htmlentities($_GET['first_name']) : ''; ?>"/>
所有人:


只需连接两个输入:

<?php 
if (isset($_GET['first_name'], $_GET['last_name'])) {
    $full_name = htmlentities($_GET['first_name'] . " " . $_GET['last_name']);
} else {
    $full_name = '';
}
?>

您能否共享
last\u name
input的代码?将这两个参数都放在第二页的url中。www.site.com?first_name=abc&second_name=xyz。来自上一个文件的代码现在已编辑,只需将first_name替换为second_name
var_dump($_GET)确保下一页有get不,我不想这样做。。只需告诉我上面所做的连接。使用&sign
&
用于分隔两个不同的输入参数。不能在单个输入字段中使用它。
<?php 
if (isset($_GET['first_name'], $_GET['last_name'])) {
    $full_name = htmlentities($_GET['first_name'] . " " . $_GET['last_name']);
} else {
    $full_name = '';
}
?>
<input class="input" type="text" name="ownerPrint" readonly value="<?php echo $full_name; ?>"/>