Jump to content

Drop down menu array selecting the data


bumdeal2

Recommended Posts

Hey guys,

 

I have a drop down menu like so <select name="Categories[]">

                                                    <Option value="Horror" Name="Horror">Horror</Option>

                                                    <Option value="Romance" Name="Romance">Romance</Option>

 

                                                    .........................................

 

Like that, just out of interest once the user has selected the option I am unsure on how to extract what the user chose from the drop down menu, how do you grab the value from array of the drop down menu that the user has selected. Any help A.S.A.P would really be appreciated. It also has to be an array.

 

I also thought of using the $_POST['Categories']; to try grab the value if that is the correct way to go about it.

 

 

Thank you in advance.

Link to comment
Share on other sites

I also thought of using the $_POST['Categories']; to try grab the value if that is the correct way to go about it.

 

Yes, but there is no reason to have Categories[] as an array unless you allow multiple selections, which you are not at this point.  And this is assuming that you have method="post" in your form.

Link to comment
Share on other sites

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.