Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. require_once("include/database.php");
  3. if(isset($_POST['submit'])) {
  4. connect_bookstore(); // custom function
  5. $spassword = sha1($_POST['password']);
  6. $username = $_POST['username'];
  7. if ( checkpassword($username,$spassword) ) { //custom function
  8. header('Location:insert.php');
  9. exit;
  10. } else {
  11. $message = "Login failed!";
  12. }
  13. }
  14. ?>
  15.  
  16. <?php
  17. if (isset($message)) {
  18. echo $message;
  19. }
  20. ?>
  21.  
  22. <?php
  23. session_start();
  24.  
  25. require_once("include/database.php");
  26. if(isset($_POST['submit'])) {
  27. connect_bookstore(); // custom function
  28. $spassword = sha1($_POST['password']);
  29. $username = $_POST['username'];
  30. if ( checkpassword($username,$spassword) ) { //custom function
  31. header('Location:insert.php');
  32. exit;
  33. } else {
  34. $_SESSION['message'] = "Login failed!";
  35. header('location: /yourfile.php');
  36. exit;
  37. }
  38. }
  39.  
  40. if(isset($_SESSION['message']))
  41. {
  42. echo $_SESSION['message'];
  43. unset($_SESSION['message']);
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement