Php and Checkboxes
Posted: Fri Jul 25, 2003 10:24 am
Hey there,
I've got a problem here that I can't seem to work out. There is a rather large form with a lot of checkboxes, and I need to check the html query line and check the boxes accordingly. Rather than do this:
<input type="checkbox" name="check" value="me <? if ($check==me) { echo "SELECTED"; } ?>> for each checkbox
Are there built-in variables in php that would allow me to say:
<input type="checkbox" name="check" value="me <? if ($name==$value) { echo "SELECTED"; } ?>>
So that $name for this particular case would equal check and $value would equal me. Do such variables exsist? This method would allow me to cut and paste the same piece of code over and over without having to manually type everything in each time. If no such variables exsist, then does anyone have any other ideas?
Thanks,
Jesse Vernon
I've got a problem here that I can't seem to work out. There is a rather large form with a lot of checkboxes, and I need to check the html query line and check the boxes accordingly. Rather than do this:
<input type="checkbox" name="check" value="me <? if ($check==me) { echo "SELECTED"; } ?>> for each checkbox
Are there built-in variables in php that would allow me to say:
<input type="checkbox" name="check" value="me <? if ($name==$value) { echo "SELECTED"; } ?>>
So that $name for this particular case would equal check and $value would equal me. Do such variables exsist? This method would allow me to cut and paste the same piece of code over and over without having to manually type everything in each time. If no such variables exsist, then does anyone have any other ideas?
Thanks,
Jesse Vernon