i can't figure out how to get recaptcha to work with my code properly and i'm just learning to code i was wondering if anyone could help with my coding. heres my code below and thanks in advance.

<html><head> <meta name="GENERATOR" content="Evrsoft First Page"> <style>#conash3D0 { DISPLAY: none } </style> </head> <body>Harry Potter Book 5 

<?php // Change below to the email address where you want to receive the message. // (inside the quote marks 'receive@yourdomain.com'') $myemail = 'billyf431@gmail.com'; $autorespond = '$email'; $from = 'billyf431@gmail.com'; $test = 'billy431@live.ca'; $to = '$email';$subject = 'Harry Potter 7 Book Order'; $subject2 = 'Order recieved'; $op = $_POST[op];if($op == 'contact') { $name = stripslashes($_POST[name]); $email = stripslashes($_POST[email]); $phone = stripslashes($_POST[phone]); $goderich = stripslashes($_POST[goderich]); $kincardine = stripslashes($_POST[kincardine]);if(!$name) { $status = "Please enter your name.
"; } if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$",$email)) { $status .= "We're sorry, but you've entered an incorrect email address.
"; } if(!eregi("^[0-9]{3}-[0-9]{3}-[0-9]{4}$",$phone)) { $status .= "You have entered and invalid phone number or not included '-' dashes.
"; } if(!$status) { $header = "From: $emailrnReply-To: $emailrn"; $header2 = "From: $myemailrnReply-To: $emailrn";$message = " Name: $name Email: $email Phone Number: $phone Goderich: $goderich Kincardine: $kincardine "; $message2 = " We Have Recieved Your Order and Will $to Have it ready for pickup within 48 hours if the item is not avalible you will recieve an ";if(mail($myemail, $subject, $message, $header)) if(mail($email, $subject2, $message2, $header2)) { $status = "Thank you for your Order

"; } else { $status = "There was a problem sending your order, please try again later.

"; }} else { $status .= "
Please press Resubmit Form to resubmit.

"; } }$referer = $_SERVER[HTTP_REFERER];if(!preg_match('#^http\:\/\/[a-z0-9-]+.([a-z0-9-]+.)?[a-z]+#i', $referer)) { unset($referer); }?><?php print $status; ?> <form method="post" action="&lt;?php print $_SELF; ?&gt;" &gt;<input="" value="contact" type="hidden" name="op"> Name:
<input size="35" name="name">
E-mail address:
<input size="35" name="email">

Phone Number: 
<input size="35" name="phone">
Store:
<input value="X" type="checkbox" name="goderich">Goderich
<input value="X" type="checkbox" name="kincardine">Kincardine


@require_once('recaptchalib.php'); $publickey = "6LdiiLwSAAAAAKRgkcUtC7nZxQthhiUBA1W9-wEu"; $privatekey = "6LdiiLwSAAAAADdLBwN4gCEgv47JDRNghGwY4pgB";

$resp = null; $error = null;

if ($_POST["submit"]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);

if ($resp->is_valid) {

echo "
Email sent!

"; exit(1);

} else { echo "Sorry cannot send email as you've failed to provide correct captcha! Try again..."; } } echo recaptcha_get_html($publickey, $error); ?>


<input value=" Submit Order" type="submit"> </form>

</body></html>

Hello billy431,
Looks like it has been more than a week since you posted your query. I hope you have got your problem fixed by now. However, i looked at your codes and corrected the errors i found. Hers is the code:

<html>
<head>
<meta name="GENERATOR" content="Evrsoft First Page">
<style>#conash3D0 { DISPLAY: none } </style>
</head>
<body>Harry Potter Book 5 

<?php // Change below to the email address where you want to receive the message. // (inside the quote marks 'receive@yourdomain.com'')
$myemail = 'billyf431@gmail.com';
$autorespond = '$email';
$from = 'billyf431@gmail.com';
$test = 'billy431@live.ca';
$to = '$email';
$subject = 'Harry Potter 7 Book Order';
$subject2 = 'Order recieved';
$op = $_POST['op'];
if ($op == 'contact') {
    $name = stripslashes($_POST['name']);
    $email = stripslashes($_POST['email']);
    $phone = stripslashes($_POST['phone']);
    $goderich = stripslashes($_POST['goderich']);
    $kincardine = stripslashes($_POST['kincardine']);
    if (!$name) {
        $status = "Please enter your name.
";
    }
    if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$", $email)) {
        $status .= "We're sorry, but you've entered an incorrect email address.
";
    }
    if (!eregi("^[0-9]{3}-[0-9]{3}-[0-9]{4}$", $phone)) {
        $status .= "You have entered and invalid phone number or not included '-' dashes.
";
    }
    if (!$status) {
        $header = "From: $emailrnReply-To: $emailrn";
        $header2 = "From: $myemailrnReply-To: $emailrn";
        $message = " Name: $name Email: $email Phone Number: $phone Goderich: $goderich Kincardine: $kincardine ";
        $message2 = " We Have Recieved Your Order and Will $to Have it ready for pickup within 48 hours if the item is not avalible you will recieve an ";
        if (mail($myemail, $subject, $message, $header))
            if (mail($email, $subject2, $message2, $header2)) {
                $status = "Thank you for your Order

";
            } else {
                $status = "There was a problem sending your order, please try again later.

";
            }
    } else {
        $status .= "
Please press Resubmit Form to resubmit.

";
    }
}
$referer = $_SERVER['HTTP_REFERER'];
if (!preg_match('#^http\:\/\/[a-z0-9-]+.([a-z0-9-]+.)?[a-z]+#i', $referer)) {
    unset($referer);
} ?>

<?php print $status; ?> 
<form method="post" action="&lt;?php print $_SELF; ?&gt;" &gt;<input="" value="contact" type="hidden" name="op"> Name:
<input size="35" name="name">
E-mail address:
<input size="35" name="email">

Phone Number: 
<input size="35" name="phone">
Store:
<input value="X" type="checkbox" name="goderich">Goderich
<input value="X" type="checkbox" name="kincardine">Kincardine

<?php
@require_once('recaptchalib.php'); $publickey = "6LdiiLwSAAAAAKRgkcUtC7nZxQthhiUBA1W9-wEu"; $privatekey = "6LdiiLwSAAAAADdLBwN4gCEgv47JDRNghGwY4pgB";

$resp = null; $error = null;

if ($_POST["submit"]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);

if ($resp->is_valid) {

echo "
Email sent!

"; exit(1);

} else { echo "Sorry cannot send email as you've failed to provide correct captcha! Try again..."; } } echo recaptcha_get_html($publickey, $error); ?>


<input value=" Submit Order" type="submit"> </form>

</body></html>

Please let me know if it still contains errors.
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.