Grow your CSS skills. Land your dream job.

Help with Contact Form please

  • jim
    # October 30, 2008 at 2:35 pm

    Hi, love your work, however, me being a designer and not a coder have a little help needed!
    I have uploaded your contact form, my host supports php and all that good stuff, yet I get an error on submitting the form.
    I am guessing I have set up the contactengine.php wrong, here is a link to the form:

    http://www.glass.netcom21.co.uk/contact2/index.html

    Here are the contents of my contactengine.php:

    <?php

    // CHANGE THE VARIABLES BELOW

    $EmailFrom = "info@northerncarglass.com";
    $EmailTo = "info@northerncarglass.com";
    $Subject = "Contact Form Submission";

    $Name = Trim(stripslashes($_POST));
    $Tel = Trim(stripslashes($_POST));
    $Email = Trim(stripslashes($_POST));
    $Message = Trim(stripslashes($_POST));

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

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

    // redirect to success page
    // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE
    if ($success){
    print "<meta http-equiv="refresh" content="0;URL=contactthanks.html">";
    }
    else{
    print "<meta http-equiv="refresh" content="0;URL=error.html">";
    }
    ?>

    Any help greatly apreciated!
    Jim

    # October 30, 2008 at 4:30 pm

    I don’t know, I couldn’t see what your error was because of the custom error page – it looks like the error page that it briefly displays holds the answer though.

    jim
    # October 30, 2008 at 5:27 pm

    Yeah, I can’t stop the redirect, not sure how…
    I managed to take a screenshot of it though, amazingly :)

    jim
    # October 30, 2008 at 6:01 pm

    OK, so I fixed part of the problem, I changed ‘Tel’ to ‘City’ and that cleared that up, so now I am just getting:

    jim
    # October 30, 2008 at 6:04 pm

    Update: OK, so it seems that the email adress I was using is blocked, I will contact their host and resolve that.

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

You must be logged in to reply to this topic.

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