Give help. Get help.

  • # February 20, 2012 at 11:53 am

    Hi All,

    I downloaded Chris’s simple contact form, and, since I know pretty much nothing about PHP, I was hoping to get some help..

    Below is my markup:

    And this is the PHP that I modified (I was hoping that’s what I had to do) to match my markup:

    < ?php

    $EmailFrom = "";
    $EmailTo = "";
    $Subject = "Nice & Simple Contact Form by CSS-Tricks";
    $Name = Trim(stripslashes($_POST));
    $Email = Trim(stripslashes($_POST));
    $Phone = Trim(stripslashes($_POST));
    $Comments = Trim(stripslashes($_POST));

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

    // prepare email body text
    $Body = "";
    $Body .= "name: ";
    $Body .= $name;
    $Body .= "n";
    $Body .= "email: ";
    $Body .= $email;
    $Body .= "n";
    $Body .= "phone: ";
    $Body .= $phone;
    $Body .= "n";
    $Body .= "comments: ";
    $Body .= $comments;
    $Body .= "n";

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

    // redirect to success page
    if ($success){
    print "";
    print "";

    My issues are:

    1. I receive the email, but the content is empty
    2. How do I modify the From field so that it would show actual email it came from instead of static email I set..
    3. I would like to get rid of the re-direct page as I’m using this form on the footer of a website..

    Thanks a bunch in advance and sorry for very basic question!

    # February 20, 2012 at 1:44 pm

    I’m having the same issue with an empty email.. I get the template printed, but the user input is not printed in the email.

    # September 24, 2012 at 11:09 am

    Hi, I’m having the same problem with an empty email. I removed ‘print’ which just made the whole thing hang.

    Any advice to get this working?

    # September 25, 2012 at 1:16 am

    This is a really good contact form if you don’t know what you’re doing.

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

You must be logged in to reply to this topic.