Advertisement
Guest User

Untitled

a guest
Aug 12th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name = "viewport" content = "width = 320, initial-scale = .9, user-scalable = yes">
  6. <link rel="stylesheet" type="text/css" href="css/style.css" />
  7. <title>Login | AG</title>
  8. </head>
  9.  
  10. <body>
  11.  
  12.  
  13. <div class="wrapper">
  14.  
  15. <div class="login_box">
  16. <center>
  17. <h1>Login | AG</h1>
  18.  
  19. <br/>
  20.  
  21. <form action="login.php" method="post">
  22. <table>
  23. <tr><td><b>Username:</b></td><td><input type="text" name="username"/></td></tr>
  24. <tr><td><b>Password:</b></td><td><input type="password" name="password"/></td></tr>
  25. </table>
  26. <input type="hidden" name="process_login" value="1"/>
  27. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Submit"/>
  28. </form>
  29. </center>
  30. <?php
  31.  
  32. session_start();
  33.  
  34. if(isset($_POST['process_login'])){
  35. include('php/db.php');
  36.  
  37. $query = mysql_query("SELECT USERS.USERNAME, USERS.PASSWORD FROM USERS") or die (mysql_error());
  38. while ($result = mysql_fetch_array($query)){
  39. if (strtoupper($_POST['username']) != $result['USERNAME'] || md5($_POST['password']) != $result['PASSWORD']){
  40.  
  41. echo "<center><font color=red>Incorrect username or password</font><center>";
  42. }
  43. else{
  44. $_SESSION['username'] = $_POST['username'];
  45. #echo $_SESSION['username'];
  46. #printr ($_SESSION);
  47. echo "<script> window.location = \"home.php\"; </script>";
  48. }
  49. //echo $result['username'];
  50. }
  51. }
  52.  
  53. ?>
  54.  
  55. </div>
  56. </div>
  57.  
  58.  
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement