Advertisement
wasdITA

Untitled

Nov 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <?php
  4.  
  5. $captcha;
  6. if (isset($_POST['g-recaptcha-response'])) {
  7. $captcha = $_POST['g-recaptcha-response'];
  8. }
  9. if (!$captcha) {
  10. echo '<h2>Fail</h2>
  11. <h3>Compila il captcha in maniera coretta... </h3></center>
  12. <center><h4>come illustrato nell immagine</h4>';
  13. exit;
  14. }
  15. $ip = $_SERVER['REMOTE_ADDR'];
  16. $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $recaptchasecretKey . "&response=" . $captcha . "&remoteip=" . $ip);
  17. $responseKeys = json_decode($response, true);
  18. if (intval($responseKeys["success"]) !== 1) {
  19. echo '<h2>Complimenti</h2>
  20. <h3>Modulo inviato correttamente.<br> Anche se hai premuto troppe volte il tasto invio :)</h3></center>
  21. <center><h4>Verrai automaticamente riportato alla home a breve</h4>
  22. <meta http-equiv="refresh" content="10;URL=https://sanik.it">';
  23. } else {
  24. echo '<h2>Complimenti</h2>
  25. <h3>Modulo inviato correttamente</h3></center>
  26. <center><h4>Verrai automaticamente riportato alla home a breve</h4>
  27. <meta http-equiv="refresh" content=";URL=../index">';
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement