Help using arrays
Posted: Wed Jun 07, 2006 10:45 am
Hi
Im VERY new to PHP
Im trying to get my head around using arrays with php.
So far ive slapped together the following code but it doesnt output any results.
Id appreciate any help anyone can give with this as its doing my head in.
Im VERY new to PHP
Im trying to get my head around using arrays with php.
So far ive slapped together the following code but it doesnt output any results.
Id appreciate any help anyone can give with this as its doing my head in.
MAIN
Code: Select all
echo "<form method ='post' action='action.php'>";
echo "<TABLE>";
echo "<td align='center' bgcolor='#0E0E17'><input type='checkbox' name='arr[]' value='1' 1></td>";
echo "<td align='center' bgcolor='#0E0E17'><input type='checkbox' name='arr[]' value='2' 2></td>";
echo "<td align='center' bgcolor='#0E0E17'><input type='checkbox' name='arr[]' value='3' 3></td>";
echo "<input type='submit' value='-GO-'>";
echo "</table>";action.php
Code: Select all
$checkboxarray = $_POST['arr[]'];
$count = 0;
while ($checkboxarray[$count]) {
echo "$checkboxarray[$count]";
echo "<br>";
$count++;
} else {
echo "FINISHED";