Forum Moderators: coopster
$i = 0;
echo '<form name = "sometest" action = "test.php" method = "POST">';
whlie ($i < 5)
{
counter[] = 1234 + $i;
$i++;
}
echo '<input type = "submit" name = "test" value = "test">';
echo '</form>';
if (isset($_POST[test]))
{
//print the array "counter"
}
I tried using print_r($_POST[counter]) but no success...I was thinking maybe some hidden type of thing, but that's very sloppy. How do I print the "counter" array?
--Nick
while ($i < 5)
{
$counter = 1234 + $i;
echo '<input type="text" name="counter[]" value="' . $counter . '" />'
$i++;
}
// then...
if (isset($_POST['counter']))
{
print_r($_POST['counter']);
}
Apologies if you had only re-typed it for the forum post. Was this what you had?