Advertisement
Guest User

logout.php

a guest
Aug 19th, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?
  2.  
  3. // include function files for this application
  4. require_once("bookmark_fns.php");
  5. session_start();
  6. $old_user = $_SESSION["valid_user"]; // store to test if they *were* logged in
  7. $result_unreg = unset($_SESSION['valid_user']);
  8. $result_dest = session_destroy();
  9.  
  10. // start output html
  11. do_html_header("Logging Out");
  12.  
  13. if (!empty($old_user))
  14. {
  15. if ($result_unreg && $result_dest)
  16. {
  17. // if they were logged in and are now logged out
  18. echo "Logged out.<br>";
  19. do_html_url("login.php", "Login");
  20. }
  21. else
  22. {
  23. // they were logged in and could not be logged out
  24. echo "No hemos podido hacer Log Out.<br>";
  25. }
  26. }
  27. else
  28. {
  29. // if they weren't logged in but came to this page somehow
  30. echo "No te encuentras logged in, asн que no hemos podido hacer logged out.<br>";
  31. do_html_url("login.php", "Login");
  32. }
  33.  
  34. do_html_footer();
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement