I have the following piece of code which resembles a form with a drop-down list. The selected item from the list should be sent to process.php page which will do some work.
<form name="form" method="GET" action="process.php">
<div id="extra-components">
<select name="boolean">
<option value="and" selected="yes">AND</option>
<option value="or">OR</option>
<option value="not">NOT</option>
</select>
</div>
</form>
My question is: in the process.php file how do I obtain the selected value from the form? via the $_GET method?
Thanks in advance
Depending on your HTML code you can access
booleanvalue by$_GET['boolean'].$_GET['boolean']will contain one of<option>‘svalueelement until user will change it in his URL.Esit:
Tip: Don’t forget to filter user-submitted data, always. HTML, JS restrictions are nothing. ‘Always assume that user is malicious’ (@MarkB)