Advertisement
artur99

Untitled

May 8th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. $page = 0;
  5. $last_page = 0;
  6.  
  7. if(isset($_GET['page'])) $page = intval($_GET['page']);
  8. if(isset($_SESSION['last_page'])) $last_page = $_SESSION['last_page'];
  9.  
  10. $_SESSION['last_page'] = $page;
  11.  
  12. if($page == 0) {
  13.     // Prima data aici, e ok...
  14. }
  15. elseif($page == 1) {
  16.     if($last_page != 0){
  17.         echo 'Gresit! <a href="test.php">La inceput</a>';
  18.         die();
  19.     }
  20. }
  21. elseif($page == 2) {
  22.     if($last_page != 1){
  23.         echo 'Gresit! <a href="test.php">La inceput</a>';
  24.         die();
  25.     }
  26. }
  27. elseif($page == 3) {
  28.     if($last_page != 2){
  29.         echo 'Gresit! <a href="test.php">La inceput</a>';
  30.         die();
  31.     }
  32.     else {
  33.         echo 'Bravo! Perfect! <a href="test.php">La inceput</a>';
  34.         die();
  35.     }
  36. }
  37.  
  38. ?>
  39.  
  40. <a href="test.php?page=1">Buton1</a><br>
  41. <a href="test.php?page=2">Buton2</a><br>
  42. <a href="test.php?page=3">Buton3</a><br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement