<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<form method="post" action="a.php">
账号:<input type="text" name="user" /><br />
密码:<input type="password" name="pass" /><br />
<input type="submit" value="登录" />
</form>
</body>
</html>
<?php
header("Content-type: text/html; charset=utf-8");
$result=0;
$user=$_POST["user"];
$pass=$_POST["pass"];
$conn=mysqli_connect("127.0.0.1","root","root","test");
if(!$conn){
die('database connect error'.mysql_error());
}
$result=mysqli_query($conn,"select * from user where username='$user' and password='$pass'");
$array=mysqli_fetch_row($result);
if($array){
echo "登陆成功";
}
else echo "登陆失败";
mysqli_close($conn);
?>
打赏我,让我更有动力~
© 2016 - 2024 掌控者 All Rights Reserved.
Track-方丈
发表于 2018-7-31
通过,金币奖励已发放。
评论列表
加载数据中...