If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.
Post a reply to the thread: PHP Sessions Easy Question?
Click here to log in
What color is our footer?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.
PHP Sessions Easy Question? I'm feeling that I'm just having a brain fart right now, but this is driving me nuts! I'm simply trying to access a session variable from one page to the next. To test this out, I've made pages, test1.php and test2.php. The code for each is short and simple: test1: <?php session_start(); $_SESSION['name'] = "default"; echo "<html><body>Name = " . $_SESSION['name'] . "<br /><a href = 'test2.php'>Next</a></body></html>"; ?> test2: <?php session_start(); echo "<html><body>Name = " . $_SESSION['name'] . "</body></html>"; ?> Now, test1 should by default display "Name = default" It does. On page 2, I'm looking for the same, but I'm getting "Name = " I was hoping someone would be able to see what easy mistake I've made that I'm just not catching right now. Thanks for your help!
PHP Sessions Easy Question?
Forum Rules