Keep entered data and take it to another page
Posted: Tue Dec 16, 2008 2:52 am
I have file retain.php with forms. In these forms i enter necessary data, then go to another page to continue enter data (two pages are necessary, because i need to enter many data and if in one page, the page would be very long and will load slowly).
When I enter data in second page, i click on button, opens third page, in which i work with entered data.
My problem is that i dont know how data entered in first page to take to third page.....
In third page i get displayed only number 02 (not number 01)
retain.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<form method = "POST" action = "retain01.php">
<table border=0>
<tr>
<tr>
<td align="right">Number 01:</td>
<td><input type= "text" name= "number01" value="<?php echo $number01; ?>" size= "40"><br /></td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
------------------
retain01.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<form method = "POST" action = "retain02.php">
<table border=0>
<tr>
<tr>
<td align="right">Number 02:</td>
<td><input type= "text" name= "number02" value="<?php echo $number02; ?>" size= "40"><br /></td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
-----------
retain02.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<?php
$number01 = $_POST['number01'];
$number02 = $_POST['number02'];
?>
<table width="600" id="table_r">
<tr>
<td id="td_r" width="500">Number 01</td>
<td id="td_r" width="100"><?php printf("%.2f", $number01); ?></td>
</tr>
<tr>
<td id="td_r" width="500">Number 02</td>
<td id="td_r" width="100"><?php printf("%.2f", $number02); ?></td>
</tr>
</body>
</html>
When I enter data in second page, i click on button, opens third page, in which i work with entered data.
My problem is that i dont know how data entered in first page to take to third page.....
In third page i get displayed only number 02 (not number 01)
retain.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<form method = "POST" action = "retain01.php">
<table border=0>
<tr>
<tr>
<td align="right">Number 01:</td>
<td><input type= "text" name= "number01" value="<?php echo $number01; ?>" size= "40"><br /></td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
------------------
retain01.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<form method = "POST" action = "retain02.php">
<table border=0>
<tr>
<tr>
<td align="right">Number 02:</td>
<td><input type= "text" name= "number02" value="<?php echo $number02; ?>" size= "40"><br /></td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
-----------
retain02.php
<html>
<head>
<title>...</title>
</head>
<body>
<h1>...</h1>
<?php
$number01 = $_POST['number01'];
$number02 = $_POST['number02'];
?>
<table width="600" id="table_r">
<tr>
<td id="td_r" width="500">Number 01</td>
<td id="td_r" width="100"><?php printf("%.2f", $number01); ?></td>
</tr>
<tr>
<td id="td_r" width="500">Number 02</td>
<td id="td_r" width="100"><?php printf("%.2f", $number02); ?></td>
</tr>
</body>
</html>