Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/30714-get-values-from-multiple-selects/
Share on other sites

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]
<?php
foreach ($_GET as $field => $value){
  echo "<br />Field Name:  " . $field . " - Value:  " . $value";
}
?>
[/code]
Look through all fields if posted using POST method:
[code]
<?php
foreach ($_POST as $field => $value){
  echo "<br />Field Name:  " . $field . " - Value:  " . $value";
}
?>
[/code]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.