I have a 2 part form where the first part asks for how many names and addresses you'd like to add. The second part uses a for loop to make form fields where the name is an array, and the address is another array. Once the form fiends are filled in and you submit it, it's just suppose to echo the array variable values (like a receipt). I'm having trouble doing this. The trick is, is that my php server is making me use the $blah = $_POST[blah]; situation instead of just directly sending it. Here is my code...
----------------------- TEST1---
<body>
<form method=POST action=test2.php>
<input type=text size=20 name=number> NUMBER<br>
<input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2">
</form>
</body>
---------------------- TEST2---
<body>
<form method=POST action=test3.php>
<?
$number = $_POST[number];
for($count=1;$count<=$number;$count++)
{
echo "Name $count :<input type=text size=30 name=name[]><br>\n";
echo "Address $count :<input type=text size=30 name=address[]><br>\n";
}
echo "<input type=hidden value=$number name=number><br>";
?>
<input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2">
</body>
------------CANNOT FIGURE OUT TEST3----
<body>
<?
$number = $POST[number];
$name = &$POST[name];
$address = &$_POST[address];
for($count=1;$count<=$number;$count++)
{
echo "<b>Name $count :</b>$name[$count]<br>";
echo "<b>Address $count :</b>$address[$count]<br>";
}
?>
</body>
If anybody could please let me know what I'm doing wrong... It'd make me oh so happy! =]