fraser5002 Posted July 1, 2010 Share Posted July 1, 2010 hi i have a group of check boxes each of thier names are the number they appear i.e the first checkbox has name "1" etc etc when the submit button is pressed i am trying to use php to detect which ones have been pressed using this code $i = 0; while ($i < 283) { $climbed[$i] = $_POST[' "$i" ']; echo $climbed[$i]; $i++; } It does not seem to work however as my echo comes back blank even though the check boxes have been selected. and i know its due to the $_POST[' "$i" ']; part does anyone see anything wrong with what i have written? Link to comment https://forums.phpfreaks.com/topic/206419-help-with-line-of-code/ Share on other sites More sharing options...
gwolgamott Posted July 1, 2010 Share Posted July 1, 2010 try removing the quote marks you have in the $_POST[] $i wrapped in single and double quotes. currently it's looking for the $_POST of variable ' "$i" ' and no $i $_POST[$i] should work. Link to comment https://forums.phpfreaks.com/topic/206419-help-with-line-of-code/#findComment-1079813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.