Grow your CSS skills. Land your dream job.

Contact Form

  • # September 11, 2008 at 9:43 pm

    I am trying to use Chris’ contact form http://css-tricks.com/examples/NiceSimpleContactForm2/ in a site i am making, but i cannot get the PHP to work properly. It only sends:

    Quote:
    Name:
    Email:
    Message:

    and none of the actual content.

    Here is the PHP im using:

    Code:
    < ?php
    $EmailFrom = "my-email-address";
    $EmailTo = "my-email-address";
    $Subject = "Query from Website";
    $Name = Trim(stripslashes($_POST['Name']));
    $Email = Trim(stripslashes($_POST['Email']));
    $Message = Trim(stripslashes($_POST['Message']));

    // prepare email body text
    $Body = "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "n";

    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>“);

    ?>

    and heres my form:

    Code:







    What am i doing wrong:

    box
    # September 12, 2008 at 5:05 am

    You do not have a method attribute in your form tag. Add method="post" to your form.

    # September 12, 2008 at 11:33 am

    thanks box, i knew i had missed something simple.

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".