Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <html><head>The Moray College Surf Shop </head><body><h1>Member Search Results</h1>
  2.  
  3. <?php
  4. session_start();
  5.  
  6.  
  7. $username=@$_POST['username'];
  8.  
  9. $password=@$_POST['password'];
  10.  
  11.  
  12.  
  13. $db = mysql_connect('127.0.0.1', 'root', '') or die(mysql_error());
  14.  
  15.  
  16.  
  17. mysql_select_db('surf');
  18.  
  19. $query = "select * from customers where username = '$username' and password = '$password'";
  20.  
  21. $result = mysql_query($query);
  22.  
  23. $num_results = mysql_num_rows($result);
  24.  
  25.  
  26. if (!$num_results > 0) {
  27.  
  28. echo "<form action='loginshop.php' method='post'>
  29.  
  30. Username
  31.  
  32.  
  33.  
  34. <input type='text' name='username' maxlength='13' size='13'></br>
  35.  
  36. Password
  37.  
  38. <input type='text' name='password' maxlength='60' size='30'></br>
  39.  
  40.  
  41.  
  42. <input name='Continue' type='submit' value='Continue'>
  43.  
  44. </form>";
  45.  
  46. } else {
  47.  
  48.  
  49. echo "If you would like to change your details please <a href='register.php?a=change'>click here</a>";
  50.  
  51.  
  52.  
  53. $_SESSION['info'] = mysql_query($query);
  54.  
  55. }
  56.  
  57. ?>
  58.  
  59. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement