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
https://forums.phpfreaks.com/topic/245455-drop-down-menu-array-selecting-the-data/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.