Marcos01 Posted October 19, 2008 Share Posted October 19, 2008 Hello, I have a form with multiple pages. When I want to jump back from page 2 to page 1 to edit the filled out data, I lose the data which was already filled out. How can I keep that? page 1 session_start(); <form action="form.php" method="post"> Company: <input name="company" id="company" type="text" /><br /><br /> echo 'Filled out by: <input name="name" id="name" type="text" /><br /><br /> Position: <input name="position" id="position" type="text" /> Phonenumber: <input name="phonenumber" id="phonenumber" type="text" /> <input type="submit" name="next" id="next" value="next" /> </form> page 2 session_start(); $sessionid = session_id(); $company = $_POST['company']; $name = $_POST['name']; $position = $_POST['position']; $telefoon = $_POST['phonenumber']; $query ="INSERT INTO formusers (sessionid, company, name, position, phonenumber) values('{$sessionid}','{$company}','{$name}','{$position}','{$phonenumber}')"; Link to comment https://forums.phpfreaks.com/topic/129098-keepingediting-form-data-multiple-pages/ Share on other sites More sharing options...
Bendude14 Posted October 19, 2008 Share Posted October 19, 2008 the easiest option would be to store all the data in a session. Link to comment https://forums.phpfreaks.com/topic/129098-keepingediting-form-data-multiple-pages/#findComment-669253 Share on other sites More sharing options...
Marcos01 Posted October 19, 2008 Author Share Posted October 19, 2008 how do I store it? Link to comment https://forums.phpfreaks.com/topic/129098-keepingediting-form-data-multiple-pages/#findComment-669258 Share on other sites More sharing options...
Bendude14 Posted October 19, 2008 Share Posted October 19, 2008 i could spend 10 minutes writing this for you but you wont learn anything. just go do a google for php session and look at a few examples. Its pretty straight forward and once you have a start come back here with any problems you come accross Link to comment https://forums.phpfreaks.com/topic/129098-keepingediting-form-data-multiple-pages/#findComment-669275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.