kyleldi Posted September 28, 2009 Share Posted September 28, 2009 I've got a form that asks someone to enter a code before continuing to the next page. This information is posted by the form using $_POST. On the next page, I'd like a hidden field with that code in it, so I can post it to a different database and work with it there. Is there a way to obtain what was posted w/o passing it through the URL? The Session is open on both pages, so I'd be left to believe it's available, I just don't understand how to call for it w/o using a URL variable. Link to comment https://forums.phpfreaks.com/topic/175803-solved-retreiving-a-php-variable-in-session/ Share on other sites More sharing options...
trq Posted September 28, 2009 Share Posted September 28, 2009 p1.php <?php session_start(); $_SESSION['foo'] = 'bob'; echo "<a href='p2.php'>click</a>"; p2.php <?php session_start(); if (isset($_SESSION['foo'])) { echo $_SESSION['foo']; } Link to comment https://forums.phpfreaks.com/topic/175803-solved-retreiving-a-php-variable-in-session/#findComment-926375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.