Page 2 of 2

Posted: Fri Nov 11, 2005 11:46 am
by n00b Saibot
Jenk, that was only to get him to understand what he was doing wrong there... :P Although I know other shortcuts too 8)

Posted: Fri Nov 11, 2005 12:15 pm
by will83
Ok my project simplified is:


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";

}
?>
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:

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

Posted: Fri Nov 11, 2005 1:51 pm
by will83
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