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 7893677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:11:38+00:00 2026-06-03T07:11:38+00:00

this is my first time in using recaptcha on my website. I’m using PHP

  • 0

this is my first time in using recaptcha on my website.

I’m using PHP API to validate the recaptcha, it keeps saying invalid-request-cookie

I found out on different forum that http://www.example.com is different with example.com, so I register my site again without www , but still it is not working..

When I verify the recaptcha_response_field and recaptcha_challenge_field the values are correct.

here is the captcha checker:

require_once(recaptchalib.php'); 

$publickey = "not displayed"; //for security
$privatekey = "not displayed"; //for security
$error = null; 

if( $_POST ) {
    $arr = array('a' => $_POST['task'], 'b' => $_POST['recaptcha_challenge_field'], 'c' => $_POST['recaptcha_response_field']);

    if( trim($arr['a']) == 'captcha' ) {
        $resp = null;
        $error = null;
        $captcha_result = 'success';
        $resp = recaptcha_check_answer( $privatekey, $_SERVER["REMOTE_ADDR"], $arr['b'], $arr['c'] );       

        if( $resp->error ){
            $captcha_result = 'fail';
        }
        echo $captcha_result;
    } 
}

here is the HTML code:

             <div id="captcha-div">
                <script type="text/javascript">
                          var RecaptchaOptions = {
                              tabindex: 1,
                              theme: 'custom',
                              custom_theme_widget: 'recaptcha_widget'
                          };
                        </script>
                <div id="recaptcha_widget" style="display:none"><div id="recaptcha_image" style="width: 200px; height: 57px; "></div>
                <?php echo recaptcha_get_html($publickey, $error); ?>
                <div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect. Try Again.</div>
                <span class="recaptcha_only_if_audio">Type what you hear</span>
                <input type="text" id="recaptcha_response_field" name="recaptcha_response_field">
                <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type(&#39;image&#39;)">Kumuha ng larawang CAPTCHA</a></div>

                <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Le_X88SAAAAAAH3NEbkIr3w75SEQnQYwl96Y7f0"></script>
                <noscript><iframe src="http://www.google.com/recaptcha/api/noscript?k=6Le_X88SAAAAAAH3NEbkIr3w75SEQnQYwl96Y7f0" height="300" width="500" frameborder="0"></iframe><br>
                <textarea name="recaptcha_challenge_field" rows="3" cols="40">
                             </textarea>
                <input type="hidden" name="recaptcha_response_field" value="manual_challenge"></noscript></div>
                <script type="text/javascript">
                  window.onload = function() {
                      Recaptcha.focus_response_field();
                  }
                </script>
                <p id="captcha-error" style="color:red; font-weight:bold;"></p>
            </div>
            <div><a id="captcha-refresh" href="javascript:Recaptcha.reload()"></a></div>
            <div  class="recaptcha_only_if_image"><a id="captcha-audio" href="javascript:Recaptcha.switch_type(&#39;audio&#39;)"></a></div>
            <div><a id="captcha-help" href="javascript:Recaptcha.showhelp()"></a></div>
            <div id="circle-submit"></div>

can anyone help me out with this issue?

Thanks,
Justin

  • 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-06-03T07:11:39+00:00Added an answer on June 3, 2026 at 7:11 am

    As reCAPTCHA Support says:

    No, this will not result in the invalid domain. What this means is that you are not submitting the recaptcha_challenge_field to the server correctly.

    So make sure you rendering the form with recapcha corectly. Check out this link.

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

Sidebar

Related Questions

I am creating a .NET website, and this is my first time using a
this is my first time using any StackExchange website, so let's see how it
This is my first time using PayPal to handle payments from a website, and
This is my first time using the LinkedIn API. I am using Python. I
This is my first time using ICU API, and I'm having a very hard
This is my first time using joomla. I don't know if I'm using the
this is my first time using StAX for parsing XML documents (still in the
Sorry, this is my first time using this forum. Apparently people can edit my
I'm fairly new to both Django and Python. This is my first time using
I am doing this first time so I need some help. I am using

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.