![]() If you're not sure what to do you can redirect to the previous page.Ħ. What happens if none of the checkboxes (I presume they were) were checked? Or something not 1-4? Even if it's not supposed to happen you should try to account for it. Code that does this probably has some fundamental problem, like there only being one actual item or not putting something important, like output, inside the loop as well.ĥ. ![]() Everything before it will be overwritten each time through the loop. Only the last checkbox (with a value 1-4) will matter. It's not bad per se, just unusual and potentially confusing.Ĥ. If ($checkbox= '1' & $checkbox= '2')s around your loop. A: - Checkboxes all bearing the same name attribute, require them to be treated as arrays youre not doing that, in turn overwriting all other checkboxes chosen. One = is assignment, two =s is comparison. If POSTformWheelchair is Yes, then the box was checked. The problem I have is I cant seem to echo out the correct 3 answers from my question. " width="500" height = "600" align="left" border="1" />" In the PHP script (checkbox-form.php), we can get the submitted option from the POST array. Im new to PHP form handling and Ive handled it pretty well- apart from dealing PHP with Checkboxes. ![]() Now the problem is.no matter which checkbox is selected, the program will only run 'if statement' , If checkbox 1 and 3 is selected, result with result_id 5 will be shown. So, if checkbox 1 and 2 is selected, result with result_id 4 will be shown. Can anybody help me to check what's wrong with the coding.įirst, i get the value of checkbox from the previous page.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |