Posted by thomasriise on 09/07/07 12:30
Hi Guys,
I have this code:
---
<?php
echo '<html><head><title>checkbox tester</title></head>';
if ($submit){
foreach (($fruit = $_REQUEST["fruit"]) as $fruitid ) {
if ($fruitid == "notcheched") {
echo 'This fruit was <b>NOT</b> checked: '.$fruitid.'<br />';
} else {
echo 'This fruit WAS checked: '.$fruitid.'<br />';
}
}
echo '-------------------------------------<br />';
}
echo '
<form method="post" action="checker.php">
Choose a fruit:<br><br>
<input type="checkbox" name="fruit[]" value="apples">apples <br>
<input type="checkbox" name="fruit[]" value="oranges">oranges <br>
<input type="checkbox" name="fruit[]" value="peaches">peaches <br>
<input type="checkbox" name="fruit[]" value="mangos">mangos<br>
<input type="submit" name="submit">
';
if (empty($_REQUEST["fruit"])){
$fruit = 'notchecked';
}
echo '</form></body><html>';
---
Only the checked boxes gets parsed to php - how do I get the UNchecked
boxes?
Thanks!
Navigation:
[Reply to this message]
|