Azaz Posted July 26, 2010 Share Posted July 26, 2010 Ok well I submit my form and go back and all the fields are completely empty.... Like if I make this post then click back I can see everything I wrote, am I missing something? Is it even related to php or a html missing structure? Link to comment https://forums.phpfreaks.com/topic/208960-how-to-save-post-data-wo-using-cookies/ Share on other sites More sharing options...
aleX_hill Posted July 26, 2010 Share Posted July 26, 2010 Take a look at the $_SESSION variable, this might help. For example, I assume you are verifying the form inputs on the submit page? If so, then something like this: session_start(); //Run this statement before outputting anything to the browser foreach ( $_POST as $foo=>$bar ) { $_SESSION[$foo] = $bar; } //Perform verification here Then if you need to return to your form because they havent filled something in correctly, send them back and do something like this: <input type="text" <?php if(isset($_SESSION['myid'])) echo "value=\"".$_SESSION['myid']."\""; ?> id="myid"> Link to comment https://forums.phpfreaks.com/topic/208960-how-to-save-post-data-wo-using-cookies/#findComment-1091499 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.