3.5 作业修改 - Locked

海城   ·   发表于 2018-7-18   ·   CTF&WP专版

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <title> 3.5 </title>    
    </head>
    <body>
        <p>用户登陆</p>
        <form action="http://www.xxxxxxxx.com/xxx.php"  method=get>
            <table border="1">
                <tr>
                    <td align="left">name:</td>
                    <td align="left"><input type="text" name= "name"></td>
                <tr>
                    <td align="left">password:</td>
                    <td align="left"><input type="password" name ="password"></td>
            </table>

            <input type ="checkbox" name="auto" >自动登陆<br/>
            <input type ="submit" value="登陆" />
        </form>
    </body>    
</html>



<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
    die("连接失败: " . mysqli_connect_error());
}
$UserName=$_POST['name'];
$Password=$_POST['password'];
$sql = "SELECT id FROM table where username=$UserName and password=$Password";
$result = mysqli_query($conn,$sql);
if(mysqli_num_rows($result) > 0) {
    echo "登录成功";
}
else {
    echo "账号或密码错误";
}
mysqli_close($conn);
?>
</body>
</html>




打赏我,让我更有动力~

1 Reply   |  Until 2018-7-19 | 568 View

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

通过,金币奖励已发放

评论列表

  • 加载数据中...

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

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

Powered by 掌控者 Version 2.1.3