send a message of error with recaptcha
<p>i wanna show a message in the same page where recaptcha is installed this is my code!</p>

<pre><code>&lt;?php
        require_once('recaptchalib.php');
        $privatekey = "something here";
        $resp = recaptcha_check_answer ($privatekey,
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);
        if (isset($_GET['result']))
        {
        $result = $_GET['result'];
        }

        if ($result == "fail" )
        {
        $content = "The CAPTCHA code was entered incorrectly. Please go back to enter the code and send your form. ";
        }

        else if ($result == "pass" )
        {
        $content = "Thank you. Your form has been submitted.";
        }

?&gt;
&lt;div id="contact-form"&gt;
            &lt;form action="recaptcha/contact.php" method="POST" id="contactForm" &gt;
            &lt;div class="form"&gt;
                    &lt;label for="name"&gt;Your Name: &lt;span class="requireds"&gt;(Required)&lt;/span&gt;&lt;br /&gt;&lt;/label&gt;
                    &lt;input id="name" name="name" class="text-input" minlength="2" /&gt;
           &lt;/div&gt;
           &lt;div class="form"&gt;
                    &lt;label for="email"&gt;Your Email:&lt;span class="requireds"&gt;(Required)&lt;/span&gt;&lt;br /&gt;&lt;/label&gt;
                    &lt;input id="email" name="email" class=" text-input" /&gt;
           &lt;/div&gt;
           &lt;div class="form"&gt;
                    &lt;label for="phone"&gt;Your Phone:&lt;br /&gt;&lt;/label&gt;
                    &lt;input id="phone" name="phone" type="text"  maxlength="200" class="text-input"  /&gt;
           &lt;/div&gt;
           &lt;div class="form"&gt;
                    &lt;label  for="reason"&gt;Contact reason:&lt;br /&gt;&lt;/label&gt;
                    &lt;select id="reason" name="reason" class="select"&gt;
                        &lt;option&gt;Sales question &lt;/option&gt;
                        &lt;option&gt;Time/ Delivery&lt;/option&gt;
                        &lt;option&gt;My existing Order&lt;/option&gt;
                        &lt;option&gt;Technical Question&lt;/option&gt;
                        &lt;option&gt;Revision/ Support&lt;/option&gt;
                        &lt;option&gt;Other&lt;/option&gt;

                    &lt;/select&gt;
           &lt;/div&gt;
           &lt;div class="form"&gt;
                    &lt;label for="message"&gt;Message: &lt;span class="requireds"&gt;(Required)&lt;/span&gt; &lt;br /&gt;&lt;/label&gt;
                     &lt;textarea id="message" name="message" class="textarea"&gt;&lt;/textarea&gt;
           &lt;/div&gt;

           &lt;div style="margin:10px 0; width:495px; background:#FFF; -moz-border-radius:3px; border-radius:3px;"&gt;
                        &lt;?php
                                require_once('recaptcha/recaptchalib.php');
                                $publickey = "6LfPY8YSAAAAAOyYdmV61vtKzIfln9VD0pN2nO-H"; 
                                echo recaptcha_get_html($publickey);
                     ?&gt;
              &lt;/div&gt;
               &lt;input type="submit"  value="" class="send"/&gt;

            &lt;/form&gt; 
                &lt;?php echo $content; ?&gt;
</code></pre>

<p>am getting an error  and i dont know what is wrong
can somebody help me pls?</p>

<p>UPDATE!!</p>

<pre><code>&lt;?php
        require_once('recaptchalib.php');
        $privatekey = "CENSORED";
        $resp = recaptcha_check_answer ($privatekey,
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);

            $result = (isset($_GET['result']) ? $_GET['result'] : '');

            if ($result == "fail" )
            {
            $content = "The CAPTCHA code was entered incorrectly. Please go back to enter the code and send your form. ";
            }

            else if ($result == "pass" )
            {
            $content = "Thank you. Your form has been submitted.";
            }

$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$reason = $_POST['reason'];

$header = 'From: ' . $email . " \r\n";

$msg = "Sent from: " . $name . "\r\n";
$msg .= "Email: " . $email . " \r\n";
$msg .= "Phone: " . $phone . " \r\n";
$msg .= "Contact reason:" . $reason . " \r\n";
$msg .= "Message: " . $_POST['message'] . " \r\n";
$msg .= "Date and time " . date('d/m/Y', time());

$to = '';
$subject = 'Emailmakers contact page';

mail($to, $subject, utf8_decode($msg), $header);

header('location: http://contact-us.php');

?&gt;
</code></pre>

<p>THIS IS HOW I HAVE IT  NOW AND ISNT WORKING!!!!!!!!
WHAT AM I DOING WRONG?</p>
