0

Hello! I'm crazy new at PHP and I'm having problems with recieving all the info from the drop down portion of my form in the email submitted from php. The code for the HTML portion is:

    <label for="birthday">Birthday</label>
        <select name="Month" value="option">
            <option value="January">January</option>
            <option value="February">February</option>
        </select>
        <select name="Day" value="option">
            <option value="01">01</option>
            <option value="02">02</option>
        </select>
        <select name="Year" value="option">
            <option value="2012">2012</option>
            <option value="2011">2011</option> 
        </select>

PHP portion:

    $month = $_POST['month']; // not required
    $day = $_POST['day']; // not required
    $year = $_POST['year']; // not required 



$email_message .= "Month: ".clean_string($month)."\n";
$email_message .= "Day: ".clean_string($day)."\n";
$email_message .= "Year: ".clean_string($year)."\n";

All the rest of the info from the form arrives perfectly, and the "month", "day", and "year" fields in the email show:

 Month:
 Day:
 Year:

How do I fix this so it sends the selected value? Any help is much apprecated, thank you so much for reading.

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Zagga
0

Hi LuxNova_1,

Check your capitalisation. Your select field has a name of 'Month' but you are later trying to retrieve $_POST['month']

0

Ah! Twarted by the obvious. Thank you Zagga. Works perfectly, you have made a happy camper.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.