<! DOCTYPE HTML>
<html>
<head>
登陆
</head>
<body>
<form action="check.php" method="get">
username:<input type="text" name="username">
password:<input type="text" name="password">
<input type="submit" value="登陆" >
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<title>登陆校验</title>
<body>
<?php
$username=$_get['username'];
$password=$_get['password'];
$conn=mysqli_connect("127.0.0.1","Shannon","123","MyDatabase");
if($conn->connect_error){
die("连接失败:".$conn->connect_error);
}
$result=mysqli_query($conn,"SELECT *FROM user WHERE username='".$username."'AND password='".$password."'");
if(mysqli_num_rows($result>0)){
echo "登陆成功";
}else{
echo "用户名或密码错误";
}
mysqli_close($conn);
?>
</body>
</html>
?>
打赏我,让我更有动力~
© 2016 - 2024 掌控者 All Rights Reserved.
Track-方丈
发表于 2018-7-5
代码有误,无法正常执行。
请修改代码并尝试运行后再次提交。
评论列表
加载数据中...
Track-方丈
发表于 2018-7-17
通过,金币奖励已发放、
评论列表
加载数据中...