I am creating an online booking system, passing the data from each screen using $_POST and storing them as hidden input values.
page1.php records the amount of people required for booking.
page2.php records the names and ages of each person, using a loop to create the correct amount of name spaces according to the amount entered on previous page. The loop creates the name = "name1" for the first entry and "name2" for the second and so on so that they stay uunique.
page3.php POST the variables og the users name+age from the previous page and this is where i'm have the problem.
I need to carry the names and ages onto yet another page so I need to store them as a hidden input value.
I thought I could create a loop to repeat the same amount of times as there are entries and somehow define the numbers on each of the names : (name1, name2, etc)
Code: Select all
$group = 6;
$i=0;
while ($i < $group) {
$i++;
echo "<input type=\"hidden\" name=\"name[b]"."$i"."[/b]\" value=\"name"."$i"."\">\n";
}Maybe I have gone the wrong way about it. Maybe I need something that will create an array?
But not sure how, any help would be great
Will