coolerfarmer

Untitled

May 15th, 2015
6,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. $captcha;
  2. if(isset($_POST['g-recaptcha-response'])){
  3. $captcha=$_POST['g-recaptcha-response'];
  4. }
  5.  
  6. if(!$captcha){
  7. echo "CAPTCHA NULL";
  8. exit;
  9. }
  10.  
  11. $response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Ld65gYTAAAAANnz1olMsUH2-SdWJOfB_ztlvOrF&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
  12. if($response['success'] == false)
  13. {
  14. echo "CAPTCHA WRONG";
  15. }else
  16. {
  17. echo "CAPTCHA RIGHT :)";
Advertisement
Add Comment
Please, Sign In to add comment