1.4、【P90】作业提交 - 已锁定

lcuflh   ·   发表于 2018-07-24 10:02:08   ·   CTF&WP专版
<!DOCTYRE html>
<html>
 <head>
 <meta charset="utf-8">
 <title>Qzone</title>
 
 </style>
 
 </head>
 
 <form position="center" action="login.php" method="post">
 <div><input type="text" value="支持QQ号/邮箱/手机号登录" name= "zhanghao" style="width:250;height:40;"></div>
 <br/>
 <div><input type="text" value="密码" name="mima" style="width:250;height:40;" ></div>
 <br/>
 <div><input type="submit" style="background-color:#A1FFA1;width:252px;height:40px;" value="登录" style="text-align:center;font-size:14px;"></div>
 </form>
 
 </body>
</html>
<?php
 $con=mysql_connect("127.0.0.1","root","root");
 mysql_select_db("login");
 mysql_query("set name 'utf8'");
 $zhanghao = $_POST[“zhanghao”];
 $mima = $_POST["mima"];
 $zhanghao = str_replace(array('and', 'or','='), array('', '',''), $zhanghao);
 $mima = str_replace(array('and', 'or','='), array('', '',''), $mima);
 $sql_z = "select * from login_table where zhanghao = '$zhanghao'";
 $result_z = mysql_query($sql_z,$con);
 $panduan_z = mysql_fetch_array($result_z);
 $sql_m = "select * from login_table where mima = '$mima'";
 $result_m = mysql_query($sql_m,$con);
 $panduan_m = mysql_fetch_array($result_m);
 if($panduan_z && $panduan_m){
 echo "登陆成功!";
 }
 else if(!$panduan_z){
 echo "用户名不存在!";
 }
 else if(!$panduan_m){
 echo "密码错误!";
 }
 
 
 
 
?>


打赏我,让我更有动力~

1 条回复   |  直到 2018-7-24 | 1455 次浏览

Track-方丈
发表于 2018-7-24

通过,金币奖励已发放。

评论列表

  • 加载数据中...

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

© 2016 - 2024 掌控者 All Rights Reserved.