Grow your CSS skills. Land your dream job.

Help: Contact Form not working in WordPress.

  • Anonymous
    # January 1, 2011 at 3:59 am

    I do not know enough about PHP to figure out what is wrong with my contact form. I’m hoping someone can help me fix my contact form. I’m sure it must be a simple fix but can’t figure out what that fix would be.

    View the form here:
    http://aarongmoore.com/contact/

    This is the form’s code:


    < ?php get_header(); ?>



    < ?php
    $name = $_REQUEST ;
    $email = $_REQUEST ;
    $message = $_REQUEST ;
    $subject = $_REQUEST ;
    require_once('recaptchalib.php');
    $privatekey = "6LcHMr0SAAAAABP9Yj_8lTa4b9mKqoel4JInB5ui";
    $resp = recaptcha_check_answer ($privatekey,
    $_SERVER["REMOTE_ADDR"],
    $_POST["recaptcha_challenge_field"],
    $_POST["recaptcha_response_field"]);
    ?>

    < ?php if (!isset($_REQUEST)) {
    header( "Location: http://www.aarongmoore.com/contact/");
    die; } ?>

    < ?php if (empty($email) || empty($message)) { ?>
    ERROR

    E-Mail or message field(s) empty.
    < ?php die; } ?>

    < ?php if (!$resp->is_valid) { ?>
    ERROR

    reCaptcha was not filled in correctly.
    < ?php die; } ?>

    < ?php if ( preg_match( "/[rn]/", $name ) || preg_match( "/[rn]/", $email ) ) { header( "Location: http://www.aarongmoore.com/contact/");
    die; } ?>

    < ?php else { mail( "talk@aarongmoore.com", "AGM Owl: $subject", $message, "From: $name - $email" ); } ?>



    < ?php get_footer(); ?>
    # January 1, 2011 at 9:50 pm

    do you get any errors? click on the view source and read the page to see if there are any php errors. Also you might try using worpdress mail function.

    http://codex.wordpress.org/Function_Reference/wp_mail

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

You must be logged in to reply to this topic.

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