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_namevar_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; ?>"/>