Annshuk / recaptcha

Automatically exported from code.google.com/p/recaptcha
0 stars 0 forks source link

php 1.11 doesnt work #101

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The function recaptcha_get_html doesnt work... I used in this code:

<html>
    <body> 

      <form method="post" action="verify.php">
        <?php
          require_once('recaptchalib.php');
          $publickey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
          echo recaptcha_get_html($publickey);
        ?>
        <input type="submit" value="submit" name="submit"/>
      </form>

    </body>
  </html>

and nothing appear. The key is correctly, cause when i use recaptchalib.php's 
by phpbb it's work. So when i used recaptchalib.php's by phpbb the response of 
function is always FALSE. That's the code:

  require_once('recaptchalib.php');
  $privatekey = "xxxxxxxxxxxxxxxxxxxxxxxxxx";

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

        if ($response->is_valid) {
                echo "Yes, that was correct!";
        } else {
                # set the error code so that we can display it
        echo "Eh, That wasn't right. Try Again.";
        }
}else{

    echo "POST alone";

}

Original issue reported on code.google.com by markin...@gmail.com on 24 Feb 2011 at 2:54