login.html <html> <body> <form action="index.php" method="post"> Name: <input type="text" name="name"><br> password: <input type="text" name="password"><br> <input type="submit"> </form> </body> </html> <?php $con = mysql_connect("localhost","root","root"); if (!$con){die('Could not connect: ' . mysql_error());} mysql_select_db("test", $con); if (!get_magic_quotes_gpc()) { $name = addslashes($_POST['name']); } else { $name = $_POST['name']; } $query = "SELECT * FROM users WHERE name ='{$name}'"; $result = mysql_query($query)or die('<pre>'.mysql_error().'</pre>'); while($row = mysql_fetch_array($result)) { echo $row['0'] . " " . $row['1']; echo "<br />"; } echo "<br/>"; echo $query; mysql_close($con); ?>
打赏我,让我更有动力~
© 2016 - 2024 掌控者 All Rights Reserved.
Track-方丈
发表于 2018-7-4
通过。
排版有问题。
评论列表
加载数据中...