zeroecko Posted September 24, 2009 Share Posted September 24, 2009 Hi, I am fairly new to php programming. I am creating a script that requires users to go between 2 pages. Sadly, I cannot keep this to one page. Anyway, I want to make the script remember what the form results were, even after leaving the page. Right now, if I leave the page and go back, all values are reverted back to the default. I am trying to create a store using php, but it is not working out. I was hoping to avoid using a database, or delete the information off the database after I am done. Any help on this would be great. Quote Link to comment Share on other sites More sharing options...
.josh Posted September 24, 2009 Share Posted September 24, 2009 use session variables. Quote Link to comment Share on other sites More sharing options...
5kyy8lu3 Posted September 24, 2009 Share Posted September 24, 2009 Hi, I am fairly new to php programming. I am creating a script that requires users to go between 2 pages. Sadly, I cannot keep this to one page. Anyway, I want to make the script remember what the form results were, even after leaving the page. Right now, if I leave the page and go back, all values are reverted back to the default. I am trying to create a store using php, but it is not working out. I was hoping to avoid using a database, or delete the information off the database after I am done. Any help on this would be great. on the page your form posts to: put this at the top of both pages: session_start(); then save the post variables into session variables $_SESSION['username'] = $_POST['username']; then on the page where you have your form, set value="$_SESSION['username']" and if it's empty it won't matter so you don't have any need for an if statement hope that helps 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.