Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:05:26+00:00 2026-05-26T01:05:26+00:00

i wanna show a message in the same page where recaptcha is installed this

  • 0

i wanna show a message in the same page where recaptcha is installed this is my code!

<?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.";
        }

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

                    </select>
           </div>
           <div class="form">
                    <label for="message">Message: <span class="requireds">(Required)</span> <br /></label>
                     <textarea id="message" name="message" class="textarea"></textarea>
           </div>

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

            </form> 
                <?php echo $content; ?>

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

UPDATE!!

<?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');

?>

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:05:26+00:00Added an answer on May 26, 2026 at 1:05 am

    Chances are, if the page is just white with no output, your require_once() is failing. Check your error logs, and you’ll probably see something like:

    PHP Fatal error: require_once(): Failed opening required '/path/to/recaptchalib.php'

    Also, as ceejayoz suggested, you should follow reCAPTCHA’s examples and use their methodology to check for success or failure. The way you are checking your $result, if it’s not set to “pass” or “fail”, your $content variable will have nothing in it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna rewrite links like index.php?page=entry&id=15&action=edit to entry/15/edit . This is how my .htaccess
I wanna show some text (and images) in browser but this text shouldn't be
I wanna show this Shapefile data that extracted from SHP file in google map
I have a list of events for example I wanna show on a page
Hey I am using bazaar for my code, I wanna show the history of
I wanna do something like this: int main() { try { runApp(); } catch(std::exception
I have a master page(MyMasterPage.master) with two content place holders. I wanna show another
I have a field like this in my Django template: <p>{{news.description}}<p> I wanna show
i wanna to show a message box but i prefer to be server side
I wanna show a picture inside the default value of a text field. this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.