1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

wanted help to reload page if i enter wrong captcha

Discussion in 'HTML & JavaScript' started by vijaynadiad, Apr 26, 2013.

  1. vijaynadiad

    vijaynadiad Newbie

    Joined:
    Apr 26, 2013
    Messages:
    4
    Likes Received:
    0
    i want to add code in my javascript that if i open a URL there is a google recaptcha if i type wrong captcha Characters entered by you in the box do not match, pls enter carefully. this msg comes on entering wrong captcha.

    so i want javascript code to detect that captcha entered is wrong and that script can reload the page....

    thanks i am newbie i am sorry if i broken some forum rules i thik i have posted in appropriate section :)
     
  2. vijaynadiad

    vijaynadiad Newbie

    Joined:
    Apr 26, 2013
    Messages:
    4
    Likes Received:
    0
    wow 2 days no reply on BHW
     
  3. DeJohn

    DeJohn Newbie

    Joined:
    Nov 10, 2012
    Messages:
    41
    Likes Received:
    16
    Home Page:
    Just seach into your page where reCaptcha checks if the code was valid or wrong and edit as it follows (is just a part of the code):

    PHP:
    # was there a reCAPTCHA response?
    if ($_POST["recaptcha_response_field"]) {
            
    $resp recaptcha_check_answer ($privatekey,
                                            
    $_SERVER["REMOTE_ADDR"],
                                            
    $_POST["recaptcha_challenge_field"],
                                            
    $_POST["recaptcha_response_field"]);

            if (
    $resp->is_valid) {
                    echo 
    "You got it!";
            } else {
                    
    # set the error code so that we can display it
                    //$error = $resp->error;
                    
    header("Location: yourpage.php");
            }
    }
    echo 
    recaptcha_get_html($publickey$error);
    Disable the code:
    PHP:
    $error  $resp->error;
    and add below of it:
    PHP:
    header("Location: yourpage.php"); 
    You have to edit yourpage.php with the name of your php/html page.
     
  4. vijaynadiad

    vijaynadiad Newbie

    Joined:
    Apr 26, 2013
    Messages:
    4
    Likes Received:
    0
    thanks djohn :)
     
  5. vijaynadiad

    vijaynadiad Newbie

    Joined:
    Apr 26, 2013
    Messages:
    4
    Likes Received:
    0
    thanks dejohn will u please add me on gtalk vijaynadiadatgmaild0tcom
     
  6. DeJohn

    DeJohn Newbie

    Joined:
    Nov 10, 2012
    Messages:
    41
    Likes Received:
    16
    Home Page:
    Hello,

    I do not use GTalk but if you need more help with this you can post the questions here and you'll be helped.