[New post] PHP code snippet – How to make a variable available in another file?
Subash Chandran posted: "//page1.php <?php session_start(); $_SESSION['superhero'] = "batman" ?> <a href="page2.php" title="">Go to the other page</a> //page2.php <?php session_start(); // this NEEDS TO BE AT THE"
//page1.php <?php session_start(); $_SESSION['superhero'] = "batman" ?> <a href="page2.php" title="">Go to the other page</a> //page2.php <?php session_start(); // this NEEDS TO BE AT THE TOP of the page before any output etc echo $_SESSION['superhero']; ?>
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.