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']; Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.