wesmith4 0 Posted January 1, 2014 Report Share Posted January 1, 2014 Can anyone tell me how to use select tags for drop down lists in PHP? I understand the selection is sent to the server, but I don't know how to access what was selected? Thanks. Quote Link to post Share on other sites
Larry 429 Posted January 1, 2014 Report Share Posted January 1, 2014 If your select menu is named "charlie", then the selected value will be in $_POST['charlie'], assuming the form uses the POST method. The actual value of the selection comes from the value attribute, not the label between the option tags. Quote Link to post Share on other sites
HartleySan 826 Posted January 1, 2014 Report Share Posted January 1, 2014 Yes, and just to add a little, you will likely use the same PHP array to create the select list as you will to check the value posted to the server, thus making it easy to confirm the value selected, and the string or whatever that corresponds to that value. Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.