感謝樓上的大大提醒
checkpass.php程式碼:
============================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>密碼認證程式</title>
</head>
<body>
<center>
<script language = "php">
echo"name:".$name."pass:".$pass;
$correct = false;
$HaveName = true;
switch($name)
{
case "Hippo":
if($pass =="LD")
{
$correct = true;
}
break;
case "David":
if($pass =="Lanz")
{
$correct = true;
}
break;
case "Anthony":
if($pass =="Penny")
{
$correct = true;
}
break;
default:
$HaveName = false;
break;
}
if($HaveName == true)
{
if($correct == true)
{
echo "用戶: " . $name . " 登入正確<P>";
echo "~歡迎光臨大河馬與小恐龍俱樂部~";
}
else
{
echo "密碼錯誤!";
}
}
else
{
echo "資料庫裡沒這個人啦!";
}
</script>
<p><a href=login.htm>回首頁重新登入</a></p>
</center>
</body>
</html>
==================================
我看的書:PHP4互動式網頁資料庫實戰手冊
麻煩大大救救我的腦袋吧!!