here's my code
<?php
if ($_GET['action']=="" || !isset($_GET['action']))
{
echo "<form method='post' action='test.php?action=go'>";
$a=3;
for ($i=1; $i<=$a;$i++)
{
echo "<input type='text' name='testvar[$i]'><br>";
}
echo "<input type='submit'>";
echo "</form>";
}
if ($_GET['action']=="go")
{
$a=3;
for ($i=1; $i<=$a; $i++)
{
echo $_POST['testvar'][$i]."<br>";
}
echo "<form method='post' action='test.php?action=go2'>";
for ($i=1; $i<=$a;$i++)
{
echo "<input type='hidden' name='testvar[$i]' value='$_POST[testvar][$i]'>";
}
echo "<input type='submit'>";
echo "</form>";
}
if ($_GET['action']=="go2")
{
$a=3;
for ($i=1; $i<=$a; $i++)
{
echo $_POST['testvar'][$i]."<br>";
}
}
?>
now, on the last page(test.php?action=go2), if I typed in 1,2, and 3 successivly on the input boxes, shouldn't it echo "1, 2,3"?
it doesn't though, it echos:
Array[1]
Array[2]
Array[3]
what am I doing wrong?