Advertisement
Guest User

Untitled

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