Grow your CSS skills. Land your dream job.

[Continue] Contact form

  • # December 15, 2009 at 7:48 am

    It works perfectly, but i don’t get the e-mail. What’s wrong?

    # December 15, 2009 at 11:16 am

    Can you paste in your PHP Mail() function so I can see it?

    # December 15, 2009 at 11:57 am

    Yes – here it is. But i think it’s my tempoary hosting service which is the problem. I checked on my other site, and it doesn’t looks like it work. But anyway – here it is:

    Code:
    < ?php
    // -----------------------------------------
    // The Web Help .com
    // -----------------------------------------
    // remember to replace you@email.com with your own email address lower in this code.

    // load the variables form address bar
    $subject = $_POST["subject"];
    $message = $_POST["message"];
    $from = $_POST["from"];
    $verif_box = $_POST["verif_box"];

    // remove the backslashes that normally appears when entering " or '
    $message = stripslashes($message);
    $subject = stripslashes($subject);
    $from = stripslashes($from);

    // check to see if verificaton code was correct
    if(md5($verif_box).'a4xn' == $_COOKIE['tntcon'] && strlen($message) > 0 && strlen($subject) > 0 && strlen($from ) > 0 ){
    // if verification code was correct (and fields validate), send the message and show this page
    mail($_POST[‘category’], ‘(GD)’.$subject, $_SERVER[‘REMOTE_ADDR’].”nn”.$message, “From: $from”);
    // delete the cookie so it cannot sent again by refreshing this page
    setcookie(‘tntcon’,”);
    } else if(isset($message) and $message!=””){
    // if verification code was incorrect then return to contact page and show error
    header(“Location:”.$_SERVER[‘HTTP_REFERER’].”?subject=$subject&from=$from&message=$message&wrong_code=true”);
    exit;
    } else {
    echo “Et eller flere felter mangler at blive udfyldt. Gå tilbage og prøv igen.”;
    exit;
    }
    ?>
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



    Tak for din henvendelse! Vi vil besvare den hurtigst muligt.
    Fortsat god dag!

    Klik her for at gå tilbage til forsiden.


    # December 15, 2009 at 12:02 pm

    Sorry man, I can’t see anything wrong with the code. =/

    # December 15, 2009 at 12:04 pm

    Anyway, thanks for your help. I’m almost sure it’s the hosting service, because it doesn’t work on my other site too.

Viewing 5 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic.

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