ballhogjoni Posted July 30, 2007 Share Posted July 30, 2007 whenever I pass a value from an html form to a php page the POSTed data shows, but If I refresh the php page the data is lost. How would I fix this? my code that accepts the POST: $_SESSION['Username'] = $_POST['Username']; echo $_SESSION['Username']; Link to comment https://forums.phpfreaks.com/topic/62386-solved-session-issue/ Share on other sites More sharing options...
pocobueno1388 Posted July 30, 2007 Share Posted July 30, 2007 Are you calling session_start() at the top of your page? Link to comment https://forums.phpfreaks.com/topic/62386-solved-session-issue/#findComment-310477 Share on other sites More sharing options...
ballhogjoni Posted July 30, 2007 Author Share Posted July 30, 2007 yes it post the data the first time, but it seems as though the session info is lost on refresh. Link to comment https://forums.phpfreaks.com/topic/62386-solved-session-issue/#findComment-310479 Share on other sites More sharing options...
ballhogjoni Posted July 30, 2007 Author Share Posted July 30, 2007 searching though some old posts and found this if (!isset($_SESSION['started'])) { $_SESSION['started'] = $_POST['Username']; } echo $_SESSION['started']; this code works. Link to comment https://forums.phpfreaks.com/topic/62386-solved-session-issue/#findComment-310484 Share on other sites More sharing options...
calabiyau Posted July 30, 2007 Share Posted July 30, 2007 I was going to ask if register globals is turned on...I ran into an issue some time ago where having SESSION and POST both with the same variable name and things got randomly confused. Link to comment https://forums.phpfreaks.com/topic/62386-solved-session-issue/#findComment-310486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.