All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

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

    This reply has been reported for inappropriate content.

    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