I have a HTML form which is using a simple PHP mail()
script to send its contents to an email address. I have just implemented a drop down list:
Each option element does not get its own name, just a value.
Source: http://www.w3.org/TR/html401/interact/forms.html#h-17.6
Remove the name
attribute from your option elements:
And depending on the method (post
or get
) your form element is using, you should use either:
$event = $_POST["event"];
or
$event = $_GET["event"];
Don't forget to use htmlspecialchars() or mysqli_real_escape_string() if saving to a database or printing back to the user in addition to using mail().