Advertisement
Guest User

siinäpä ois

a guest
Oct 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. /* päänäyttö sivulle alareunaan
  2. */
  3.  
  4.  <form name="logout" method="post" action="logout.php">
  5.    <input type="submit" name="submit" value="Log out">
  6.   </form>
  7.  ______________________________________________________________________________
  8.  
  9. Logout.php kokonaisuudessaan
  10.  
  11. <?php session_start();?>
  12. <html>
  13. <body>
  14.  
  15. <?php
  16. $user = 'joonas';
  17. $pass = '123456';
  18.  
  19.  
  20. if (isset($_SERVER['HTTP_COOKIE']))
  21. {
  22.     $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
  23.     foreach($cookies as $cookie)
  24.     {
  25.         $mainCookies = explode('=', $cookie);
  26.         $name = trim($mainCookies[0]);
  27.         setcookie($name, '', time()-1000);
  28.         setcookie($name, '', time()-1000, '/');
  29.     }
  30. }
  31.     header('Location: login.php');
  32.  
  33. ?>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement