Hi to all,
I have 4 pages. page1.php, page2.php, page3.php and last.php.
page 1, 2 and 3 pages have one text and submit button. The values enter by user in page1.php store in session var. and clicking on 'Submit' button. page2 shuold be open. In this page same procedure should happen. while on last page , I have to show all 3 values from all 3 pages using session. I tried it guys, but I lost values in last pages.
plz, help me. here are my pages....
//page1.php
<?php
session_start();
$_SESSION['value'] = $_POST['value'];
?>
<body>
<h2 align="center" style="font-size:xx-large; color:#F06">Use of Session</h2>
<form action="page2.php" method="post" id="page2" name="page2" enctype="multipart/form-data">
<table align="center" >
<tr>
<td>Enter the Value :</td>
<td><input type="text" name="value" id="value" /></td>
</tr>
<tr><td align="center"><input type="submit" name="submit" id="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
//page2.php
<?php
session_start();
$_SESSION['value'] = $_POST['value'];
//submit = $_POST['submit'];
//if(!empty($submit))
//{
//echo "value of textbox".$_SESSION['value'];
//}
?>
<body>
<h2>Use of Session</h2>
<form action="page3.php" method="post" id="page2" name="page2" enctype="multipart/form-data">
<table >
<tr>
<td>Enter the Value :</td>
<td><input type="text" name="value2" id="value2" /></td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr><td colspan="2"> </td></tr>
<tr><td align="center"><input type="submit" name="submit" id="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
//page3.php
<?php
session_start();
$_SESSION['value'] = $_POST['value'];
$_SESSION['value2'] = $_POST['value2'];
$_SESSION['value3'] = $_POST['value3'];
$submit = $_POST['submit'];
//if(!empty($submit))
//{
//echo "value of First Page :"."<br/>".$value."<br/>"."<br/>";
//echo "value of Second Page :"."<br/>".$_SESSION['value2']."<br/>"."<br/>";
//echo "value of Third Page :"."<br/>".$_SESSION['value3'];
//}
?>
<body >
<h2 align="center" style="font-size:xx-large; color:#F06">Use of Session</h2>
<form action="last.php" method="post" id="page3" name="page3" enctype="multipart/form-data">
<br/>
<br/>
<br/>
<table>
<tr>
<td>Enter the Value :</td>
<td><input type="text" name="value3" id="value3" /></td>
</tr>
<tr><td align="center"><input type="submit" name="submit" id="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
//last.php
<?php
session_start();
$_SESSION['value'] = $_POST['value'];
$_SESSION['value2'] = $_POST['value2'];
$_SESSION['value3'] = $_POST['value3'];
$submit = $_POST['submit'];
?>
<body>
<h2>Use of Session</h2>
<form action="last.php" name="last" id="last" method="post">
<table align="center" >
<tr><td>Value1</td>
<td>Value2</td>
<td>Value3</td></tr>
<tr>
<?php if(!empty($submit))
{
?>
<td><?php echo $_SESSION['value']; ?></td>
<td><?php echo $_SESSION['value2']; ?></td>
<td><?php echo $_SESSION['value3']; ?></td>
<?php
}
?>
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="submit" id="submit" /></tr>
</table>
</form>
</body>