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. Link to comment https://forums.phpfreaks.com/topic/175296-help-remembering-form-results/ Share on other sites More sharing options...
.josh Posted September 24, 2009 Share Posted September 24, 2009 use session variables. Link to comment https://forums.phpfreaks.com/topic/175296-help-remembering-form-results/#findComment-923885 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 Link to comment https://forums.phpfreaks.com/topic/175296-help-remembering-form-results/#findComment-923919 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.