.5、后端开发基础PHP - PHP简介及PHP基本函数(下)-蒙古草原 - 已锁定

18603907360   ·   发表于 2018-08-31 16:08:52   ·   CTF&WP专版

<!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>


打赏我,让我更有动力~

1 条回复   |  直到 2018-9-3 | 1424 次浏览

Track-方丈
发表于 2018-9-3

通过,金币奖励已发放。

——周末未上班,让您久等了。

评论列表

  • 加载数据中...

编写评论内容
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.