When a form is submitted to a PHP script, the information from that form is automatically made available to the script. There are few ways to access this information, for example:. There are only two ways to access data from your HTML forms. Currently available methods are listed below:. Note : Dots and spaces in variable names are converted to underscores. PHP also understands arrays in the context of form variables see the related faq. You may, for example, group related variables together, or use this feature to retrieve values from a multiple select input. For example, let's post a form to itself and upon submission display the data:.
Standard field options
If the option does not exist or does not have a value, then the return value will be false. This is useful to check whether you need to install an option and is commonly used during installation of plugin options and to test whether upgrading is required. Any scalar values will be returned as strings.
Demo and sample scripts to download
Cancel Not a member? Sign Up Forgot Password? Dynamic populating the drop down list based on the selected value of first list We can dynamically narrow down or limit the items in a second drop down list based on the selected item from first selected item.
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. On submitting the form, how do I make sure that the selected values remain selected in the dropdowns? After trying all these "solutions", nothing work. I did some research on W3Schools before and remember there was explanation of keeping values about radio. But it also works for the Select option. See below for an example.