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

18603907360   ·   发表于 2018-8-31   ·   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 Reply   |  Until 2018-9-3 | 609 View

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

通过,金币奖励已发放。

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

评论列表

  • 加载数据中...

编写评论内容
LoginCan Publish Content
返回顶部

掌控者 © 2016. All Rights Reserved. 掌控者

Powered by 掌控者 Version 2.1.3