php下作业提交 辰星 感谢大佬桐镜!!! - 已锁定

猫绾   ·   发表于 2018-09-05 22:35:30   ·   CTF&WP专版

<!doctype html>

<html>

<head>

<meta charset = "utf-8"/>

<title>登录测试</title>

</head>

<body>

<form action="practice.php" method="POST">

账号:<input type = "text" name='u'><br/>

密码:<input type ="password" name='p'><br/>

<input type = "submit" value="提交">

</form>

</body>

</html>




//php文件

<?php

    $user=($_POST['u']);

$pass=($_POST['p']);

$con=mysqli_connect('127.0.0.1','root','root','test');

mysqli_query($con,"set names 'utf8'");

$sql="select * from testtable WHERE(username=$user)AND(password='$pass')";

$re=mysqli_query($con,$sql);

$rs=mysqli_fetch_array($re);

    if(!$re){

echo "what?";

}

if(!empty($rs)){

echo "ok";

}else{

echo "no";

}

mysqli_close($con);

?>


打赏我,让我更有动力~

1 条回复   |  直到 2018-9-6 | 1586 次浏览

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

通过,金币奖励已发放。

评论列表

  • 加载数据中...

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

© 2016 - 2024 掌控者 All Rights Reserved.