Da Warriah
08-28-2003, 03:37 PM
*sigh* why cant forms and PHP just get along and play nicely?
alright, ive got a number of checkboxes numbered like so:
<input type="checkbox" name="edit" value="1" />
<input type="checkbox" name="edit" value="2" />
<input type="checkbox" name="edit" value="3" />
...
what id like to be able to do is let the user choose any number of checkboxes, and then submit the info to another page, which will use those numbers in a bunch of stuff...but i did a simple test on the second page (edit.php):
<?php
if(!empty($edit)){
print "Not Empty: ".$edit;
} else {
print "Empty: ".$edit;
}
?>
and heres what i got:
Not Empty: 2
even if i had checkboxes 1 and 2 selected, id only get 2...and if i chose checkbox 3 plus 1, 2, or no others, id get 3...is the variable overwriting itself or something? how do it get, for example, 1, 2, and 3? or would i have to name each checkbox separately, like:
name="1" value="1"
help would be appreciated;)
alright, ive got a number of checkboxes numbered like so:
<input type="checkbox" name="edit" value="1" />
<input type="checkbox" name="edit" value="2" />
<input type="checkbox" name="edit" value="3" />
...
what id like to be able to do is let the user choose any number of checkboxes, and then submit the info to another page, which will use those numbers in a bunch of stuff...but i did a simple test on the second page (edit.php):
<?php
if(!empty($edit)){
print "Not Empty: ".$edit;
} else {
print "Empty: ".$edit;
}
?>
and heres what i got:
Not Empty: 2
even if i had checkboxes 1 and 2 selected, id only get 2...and if i chose checkbox 3 plus 1, 2, or no others, id get 3...is the variable overwriting itself or something? how do it get, for example, 1, 2, and 3? or would i have to name each checkbox separately, like:
name="1" value="1"
help would be appreciated;)