wesmith4 Posted January 1, 2014 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. Link to comment Share on other sites More sharing options...
Larry Posted January 1, 2014 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. Link to comment Share on other sites More sharing options...
HartleySan Posted January 1, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts