We'b
<html><body>
<?php
//定义变量并设置为空值
$name = $email = "";
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$name = test_input($_POST["name"]);
9 $email = test_input($_POST["email"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data, ENT_QUOTES);
return $data;
}
?>
<p>欢迎:<?php echo $name; ?>,您的表单已提交成功~</p>
<p>更多信息会发到您的邮箱:<?php echo $email; ?></P>
</body>
</html>
!!!Notice: Undefined index: email in C:\xampp\htdocs\test\welcome.php on line 9!!
这第九行怎么改
页:
[1]