The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "SVG" Oct 14 - 6:30 PM Eastern
Get a free trial // 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 in a site i am making, but i cannot get the PHP to work properly. It only sends:


    and none of the actual content.

    Here is the PHP im using:

    < ?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:


    What am i doing wrong:

    # 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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed