Guest User

Untitled

a guest
Jul 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. ===INDEX PAGE===
  2. <?php
  3. session_start();
  4. $no_phpBB = true;
  5. $pagetitle = "test";
  6. require_once("../includes/head.inc");
  7.  
  8. if(isset($_GET['sessVar'])) {
  9. $_SESSION['sessVar'] = $_GET['sessVar'];
  10. echo "Session saved as".$_SESSION['sessVar'].". Now goto <a href=\"page2.php\">Page 2</a>";
  11. }
  12. echo "<br /><br /><form method=\"get\" action=\"index.php\"> <br /><br />
  13. Variable: <input type=\"text\" name=\"sessVar\" /><input type=\"submit\" value=\"Save variable\" />";
  14. require_once("../includes/foot.inc");
  15. ?>
  16.  
  17. ===PAGE 2===
  18. <?php
  19. session_start();
  20. $no_phpBB = true;
  21. require_once("../includes/head.inc");
  22. echo "The variable is: <b>".$_SESSION['sesVar']."</b>";
  23. require_once("../includes/foot.inc");
  24. ?>
Add Comment
Please, Sign In to add comment