Jump to content

keeping/editing form data multiple pages


Marcos01

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.