感谢楼上的大大提醒
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互动式网页资料库实战手册
麻烦大大救救我的脑袋吧!!