PHP开发学习笔记:实现简单的用户登录
1、Login1.php
<!DOCTYPE html>
<html>
<head>
<title>用户登录页面</title>
<meta charset="UTF-8"/>
<style type="text/css">
*{margin: 0px; padding: 0px;}
ul {
width: 400px;
list-style: none;
margin: 50px auto;
}
li {
padding: 12px;
position: relative;
}
label {
width: 80px;
display: inline-block;
float: left;
line-height: 30px;
}
input[type='text'], input[type='password'] {height: 30px}
input[type='submit'] {margin-left: 80px; width: 50px height: 30px}
</style>
</head>
<body>
<form action="Login.php" method="post">
<ul>
<li>
<label>用户名</label>
<input type="text" name="username" placeholder="请输入登录账号"/>
</li>
<li>
<label>密码</label>
<input type="password" name="password" placeholder="请输入密码"/>
</li>
<li>
<input type="submit" value="登录">
</li>
</ul>
</form>
</body>
</html>
2、Login2.php
<!DOCTYPE html>
<html>
<head>
<title>用户登录页面</title>
<meta charset="UTF-8"/>
<style type="text/css">
*{margin: 0px; padding: 0px;}
ul {
width: 400px;
list-style: none;
margin: 50px auto;
}
li {
padding: 12px;
position: relative;
}
label {
width: 80px;
display: inline-block;
float: left;
line-height: 30px;
}
input[type='text'], input[type='password'] {height: 30px}
input[type='submit'] {margin-left: 80px; width: 50px height: 30px}
</style>
</head>
<body>
<form action="Login.php" method="post">
<ul>
<li>
<label>用户名</label>
<input type="text" name="username" placeholder="请输入登录账号"/>
</li>
<li>
<label>密码</label>
<input type="password" name="password" placeholder="请输入密码"/>
</li>
<li>
<input type="submit" value="登录">
</li>
</ul>
</form>
</body>
</html>