PHP登陆页面代码
<html>
<head>
<meta charset="utf-8">
<title>登陆页面</title>
</head>
<body>
<form action="welcome.php" method="post">
账号: <input type="text" name="name"><br>
密码: <input type="password" name="pwd"><br>
<input style="margin-left:190px" type="submit" value="登陆">
</form>
</body>
</html>
PHP登陆成功页面代码
<html>
<head>
<meta charset="utf-8">
<title>欢迎页面</title>
</head>
<body>
<?php
$name=$_POST["name"];
$pwd=$_POST["pwd"];
if($name=="tom"&&$pwd=="123"){
echo "欢迎用户".$name."访问网站!";
}else{
echo "用户名或密码错误!<br>";
echo "<a href='login.php'>返回重新输入</a>";
}
?>
</body>
</html>