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:
<select name="event">
<option name="event1" value="event1">Event 1</option>
<option name="event2" value="event2">Event 2</option>
<option name="event3" value="event3">Event 3</option>
</select>
But am struggling to find a way to send the chosen item via mail()
I have tried using the name of the select element:
$event= $_REQUEST['event'] ;
and the names of the option elements:
$event1= $_REQUEST['event1'] ;
$event2= $_REQUEST['event2'] ;
$event3= $_REQUEST['event3'] ;
But these dont seem to work for me. Does anyone know of the correct way to retrieve and send info via the selector list? Thanks
Use this for your html form:
And use this on your php page that your form submits to:
or