Hello,
I'm a complete newbie with php. i'm using php 4.2.2 and I have the following problem. I have made an form with checkboxes and i would like to have the values of these checkboxes put in an array. When I post the page I'd like to read these values from the array and simply print them. Can anybody tell me what I'm doing wrong here?
Thnx
<?php
if($_POST['submit']) {
$array = $_post['OperatingSystem'];
print("array is $array<BR>");
if(count($array) != 0) {
while (list($key, $value) = each($array)) {
echo $key . " = " . $value . "<br>";
}
}
} else {
echo <<<EOT
<form method="POST" action="$PHP_SELF">
<INPUT TYPE="CHECKBOX" NAME="OperatingSystem[]" VALUE="Unix"> Unix <br>
<INPUT TYPE="CHECKBOX" NAME="OperatingSystem[]" VALUE="Win"> Win <br>
<INPUT TYPE="CHECKBOX" NAME="OperatingSystem[]" VALUE="Linux"> Linux <br>
<INPUT TYPE="CHECKBOX" NAME="OperatingSystem[]" VALUE="Other"> Other <br><br>
<input type="submit" name="submit" value="submit">
</form>
EOT;
}
?>