<!DOCTYPE html PUBLIC "-//W3C//DTD ;html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>表单验证</title>
<meta http-equiv=" Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content=" " />
<script type="text/javascript">
</script>
<style type="text/css">
</ style>
</head>
<body>
<?php
$name = $email =$gender =$comment = $website ="";
if($_SERVER ["REQUEST_METHOD"] == "POST"){
$name = test_input($_POST["name"]);
$email = test_input($_POST["email"]);
$website = test_input ($_POST["website"]);
$comment = test_input($_POST["comment"]);
$gender = test_input($_POST["gender"]);
}
function test_input( $data){
$data = trim($data);
$data = stripeslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?> ;
<h2> php 验证实列</h2>
<form method="post" action ="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
姓名:< Eingabetyp = „Text“ Name = „Name“>
<br><br> br>
网址:<input type="text" website ="website">
<br><br>
评论:<input type="text" comment = "comment">
<br><br>
性别:
<input type="radio" name ="gender" vlaue ="female">女性
<input type="radio" name =" Geschlecht" vlaue="männlich">男性
<br><br>
<input type="submit" name="submit" value = "提交">
</form>
<?phpecho "<h2>您的输入为:</h2>";
echo "<br>";
echo $name;
echo "< br>";
echo $email;
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
? >
</body>
</html>
input 的email 没有name属性 服务端怎么获取?