• # September 11, 2012 at 12:09 am

    I am trying to get a simple contact form to work so I get an email when the form is submitted. It works great, by the way. However, I can’t get it to work with my dropdown menu. Everything else works, so I am not sure why the dropdown doesn’t work. Here is the code:
    (pretend I put the rest of the form code before and after the dropdown code)

    and the php:

    < ?php

    $EmailFrom = Trim(stripslashes($_POST)); ;
    $EmailTo = "";
    $Subject = "Incoming Inquiry from";
    $FirstName = Trim(stripslashes($_POST));
    $State = Trim(stripslashes($_POST));
    $Email = Trim(stripslashes($_POST));
    $Message = Trim(stripslashes($_POST));

    // validation
    if (!$validationOK) {
    print "";

    // prepare email body text
    $Body = "";
    $Body .= "Full Name: ";
    $Body .= $FirstName;
    $Body .= "n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "n";
    $Body .= "Project Type: ";
    $Body .= $State;
    $Body .= "n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "n";

    // send email

    // redirect to success page
    if (mail($EmailTo, $Subject, $Body, "From: < $EmailFrom>")){
    print "";
    print "";

    Any help would be greatly appreciated on this problem. When I get the email, everything is filled in, except for the part where I am trying to get 'State'. Thank you very much in advanced!

    # September 11, 2012 at 12:28 am

    This reply has been reported for inappropriate content.

    There is a stray ‘code’ tag in the select that could be slopping it up , also, you will need to make sure “Trim” is not capitalized…it needs to be all lowercase.

    But the actual issue is that you are not setting a value in the options…you should have something like this:

    # September 11, 2012 at 4:17 am

    This reply has been reported for inappropriate content.

    Trim will work capitalised or not, but kgscott is on the money, should be kept as standard lower case.

    # September 11, 2012 at 10:00 am

    Perfect. Works great. Thank you very much!

    # September 11, 2012 at 3:42 pm

    This reply has been reported for inappropriate content.

    @andy_unleash yes, trim will work capitalized, but for convention sake (and mostly my sanity) it has to be all lower case! hahaha.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.