<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
#
表單驗證< ;/title><元名稱="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 $name;######echo "
";######echo $email; ###
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
?>
##;
input 的email 沒有name屬性 服務端怎麼取得?
##