starfleetrp Posted December 15, 2006 Share Posted December 15, 2006 I am can not seem to find a way to do this, I have been looking for half and hour (partially that I do not know what to look for)What I have is a form that has a bunch of select boxs (all with a different name, actually an ID number from the database)What I want to do is be able to loop though all of the submitted data from each one and analyize it. This would be no problem if I knew the names of all of the select boxs, but I dont. Quote Link to comment https://forums.phpfreaks.com/topic/30714-get-values-from-multiple-selects/ Share on other sites More sharing options...
doni49 Posted December 15, 2006 Share Posted December 15, 2006 How are they named?If there's something about them that will differentiate them from other fields you could use the following. You can loop through ALL the fields (post or get method).Look through all fields if posted using GET method:[code]<?phpforeach ($_GET as $field => $value){ echo "<br />Field Name: " . $field . " - Value: " . $value"; }?>[/code]Look through all fields if posted using POST method:[code]<?phpforeach ($_POST as $field => $value){ echo "<br />Field Name: " . $field . " - Value: " . $value"; }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/30714-get-values-from-multiple-selects/#findComment-141553 Share on other sites More sharing options...
starfleetrp Posted December 15, 2006 Author Share Posted December 15, 2006 Thanks for the reply, however for some reason my php gives out no errors and when an error occures I just get a white screen.This is what is happening when I added the code you posted.Edit: I fixed the problem Quote Link to comment https://forums.phpfreaks.com/topic/30714-get-values-from-multiple-selects/#findComment-141564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.