<?php require 'config.php'; $DBConnection = mysql_connect ( "$dbhost", "$dbuser", "$dbpwd" ); mysql_select_db ( "$dbdatabase" ); if(isset($_GET['submit']) && $_GET['submit']){ $sql="select * from test where name='".$_GET['username']."'and password='".$_GET['password']."'"; //echo $sql;exit; $result=mysql_query($sql,$DBConnection); $num=mysql_num_rows($result); if($num>=1) { echo "hello,".$_GET['username']; } else { echo"404 not found"; } } ?> <form action="login.php" method="GET"> <table> <tr> <td>username</td> <td><input type="textbox" name="username"/></td> <td>password</td> <td><input type="textbox" name="password"></td> <td>submit</td> <td><input type="submit" name="submit"></td> </tr> </table> </form> |