<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<元名称="keywords" content="" //>
<脚本类型="text/javascript">
##<样式类型=“text/css”>
$name = $email =$性别 =$comment = $website ="";
#if($_SERVER["REQUEST_METHOD"] == "POST"){
$name = test_input($_POST["姓名"]);
$email = test_input($_POST["电子邮件"]);
$website = test_input($_POST["网站"] );
$comment = test_input($_POST["comment"]);
$gender = test_input($_POST["gender"]);
}
function test_input($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
#< h2> php 验证实列
#
echo "
echo "
";
echo $name;
echo "
";
echo $email;
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
?>
</body>
</html>