3.5php下 漫天星宇作业 - 已锁定

漫天星宇   ·   发表于 2018-07-30 19:09:01   ·   CTF&WP专版

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title></title>

</head>

<body>

<form method="post" action="a.php">

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

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

<input type="submit" value="登录" />

</form>

</body>

</html>



<?php

header("Content-type: text/html; charset=utf-8");

$result=0;

$user=$_POST["user"];

$pass=$_POST["pass"];

$conn=mysqli_connect("127.0.0.1","root","root","test");

if(!$conn){

die('database connect error'.mysql_error());

}

$result=mysqli_query($conn,"select * from user where username='$user' and password='$pass'");

$array=mysqli_fetch_row($result);

if($array){

echo "登陆成功";

}

else echo "登陆失败";

mysqli_close($conn);

?>


打赏我,让我更有动力~

1 条回复   |  直到 2018-7-31 | 1333 次浏览

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

通过,金币奖励已发放。

评论列表

  • 加载数据中...

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

© 2016 - 2024 掌控者 All Rights Reserved.