Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(isset($_SESSION['mysessionvariable'])==false)//if your variable isn't there
  4. {
  5. session_unset();//so lets destroy whatever session there was and bring them to login page
  6. session_destroy();
  7. //Put HTML page
  8. ?>
  9.  
  10. <html>
  11. <head>
  12. You have to be logged in to access this page.<br>Redirecting to login page.
  13. </body>
  14. </html>
  15.  
  16.  
  17.  
  18. <?php
  19.  
  20. }
  21. else //otherwise, they can see the page
  22. {
  23. ?>
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. <html>
  34. <head>
  35. you can add/delete job now
  36.  
  37. </body>
  38. </html>
  39.  
  40. <?php
  41. }
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement