using session to store data and use at a later stage
Moderator: General Moderators
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
Ok my project simplified is:
Page 1:
Page 2:
Page 3:
So that creates the correct amount of rows according the size of the group requiring insurance.
Page: 4
Just some more text boxes taking address and other details.
Page: 5
Page which displays the details so far.
With regards to displaying the Initials and Surname collected on Page 3:
Can anyone suggest something to use on my 5th page?
Thanks
Will
Page 1:
Code: Select all
<form name="form1" action="step2.php" method="post">
<input size="3" maxlength="1" name="adults" id="adults" />
<input size="3" maxlength="1" name="children" id="children" />
<input type="submit" value="calculate" />
</form>Page 2:
Code: Select all
<?php
session_start(); //Start Session
header("Cache-control: private"); //ie6 fix
$adults=$_POST['adults'];
$children=$_POST['children'];
$premium = bcmul(157,$adults,2) + bcmul(79,$children,2);
echo "$premium";
?>Page 3:
Code: Select all
<?php
$adults=$_SESSION['adults'];
$children=$_SESSION['children'];
$aps = $adults + $children;
$i = 0;
while ($i<$aps) {
$i++;
print "<tr><td>\n";
print "<input name=\"initial"."$i"."\" />\n";
print "<input name=\"surname"."$i"."\" />\n";
print "</td></tr>\n";
}
?>Page: 4
Just some more text boxes taking address and other details.
Page: 5
Page which displays the details so far.
With regards to displaying the Initials and Surname collected on Page 3:
Code: Select all
<?php
$_SESSION['initial ? //here... Someway of recalling the stored variables from the session data.
//here....For loop reeling off the stored variables.
?>Can anyone suggest something to use on my 5th page?
Thanks
Will
Ok I should have shown you this before:
This is what i'm trying to re-create. You see after the details are taken, it shows you the lilst of names to be insured.
http://www.healthcareinternational.com/ ... lIndex.htm
Will
This is what i'm trying to re-create. You see after the details are taken, it shows you the lilst of names to be insured.
http://www.healthcareinternational.com/ ... lIndex.htm
Will