数据库
1.登录界面
登录界面实现账号、密码匹配数据库登录。登陆成功则跳转到首页page.html。
demo1.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>demo1</title>
</head>
<body>
<form method ="POST" action="demo1.php">
<center><h1>登录</h1>
账号:<input type="text" name="username"></input>
<br>
密码:<input type="password" name="passwd"></input>
<br>
<br>
<input type="submit" value="登录"></input>
</form>
</body>
</html>
demo1.php
<?php
$host="127.0.0.1";
$id="root";
$pwd="123456";
$database="test";
$conn=mysqli_connect($host,$id,$pwd,$database);
if($conn==true) //连接成功
{
echo "connect success<br>";
$username=$_POST['username'];
$password=$_POST['passwd'];
$sql="select * from users where username='".$username."' and password='".$password."'";
$result=mysqli_query($conn,$sql);
if($result==false)
echo "false";
else {
$items&