Have a form with a dropdown list with the first option selected by defualt. How can I get the value the user selects into my data base? Thanks in advance for your help?
HTML FORMS DROP DOWN LIST:
<select name="extrafield5">
<option value="NOW" selected="selected">Submit order now</option>
<option value="REVIEW">Submit my order for review</option>
</select>
IN PHP FILE
if (isset($_POST['extrafield5'])){
$extrafield5 = $_POST['extrafield5'];
}
else {$extrafield5 = '';}
Here is a sample segment with a similar requirement(PHP-MySQL):
filename.php
Make appropriate changes according yo tour requirement. Here the PHP code is written in the same file(Otherwise specify the form action with the .php file name).