<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form method="post" action="http://localhost/01/01.php">
用户名:
<input type="text" name="name" />
密码:
<input type="password" name="password" />
<input type="submit" />
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?php
$i= $_POST["name"] ;
$m= $_POST["password"];
$conn=mysqli_connect("127.0.0.1","root","root");
mysqli_set_charset($conn,'utf8');
mysqli_select_db($conn,'php');
$sql="select * from a where name='$i' and password ='$m' limit 1";
$que=mysqli_query($conn,$sql);
if($que and mysqli_num_rows($que)>=1){echo '登录成功';}
else{echo '登录失败';}
mysqli_close($conn);
?>
</body>
</html>
打赏我,让我更有动力~
© 2016 - 2024 掌控者 All Rights Reserved.
Track-方丈
发表于 2018-9-3
通过,金币奖励已发放。
——周末未上班,让您久等了。
评论列表
加载数据中...