【发布时间】:2016-06-15 05:04:45
【问题描述】:
我正在尝试通过 GET 方法获取两个文本框的值。但是当我尝试打印它们时。我做不到。当我使用单个文本框时,代码可以完美运行。
<?php
if(isset($_GET['name']) && isset($_GET['id']))
{
$username = $_GET['name'];
$userid = $_GET['id'];
echo 'Hi '.$username.'<br>';
echo "Emp Id is ".$userid;
}
?>
<form action="contact-DB.php" method="GET">
Enter Employee Name : <input type = "text" name = "name"><br>
Enter Employee ID : <input type = "text" name = "id">
<input type = "button" name="submit" value="Submit">
【问题讨论】:
-
你进入if语句了吗?
-
“做不到”是什么意思?你的输出是什么?
-
当我尝试从单个文本框中回显值时。它可以工作,但是当我对 2 个文本框做同样的事情时。 echo 语句不起作用。
标签: php