Guest User

Untitled

a guest
Jan 24th, 2018
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <script src='https://www.google.com/recaptcha/api.js?hl=es'></script>
  2. </head>
  3.  
  4. <div class="g-recaptcha" data-sitekey="6LdOPUEUAAAAAHDrxcTX40LZ-y9vi6INu6wLEaU2"></div>
  5. <button type="submit" class="btn btn-skin pull-right" id="btnContactUs">Enviar</button>
  6.  
  7. <?php
  8. //Variables del formulario de contacto
  9.  
  10. @$nombre = addslashes($_POST['nombre']);
  11. @$email = addslashes($_POST['email']);
  12. @$contenido = addslashes($_POST['contenido']);
  13. @$mensaje = addslashes($_POST['mensaje']);
  14.  
  15. //Mensaje de contacto
  16. $cabeceras = "From: Renovaburgos"
  17. . ": $email";
  18. $asunto = "Mensaje desde la pagina Web";
  19. $email_to = "info@academiafuture.com";
  20. $contenido = "$contenido"
  21. ."n"
  22. . "Nombre: $nombren"
  23. . "Email: $emailn"
  24. . "Contenido: $contenidon"
  25. . "Mensaje: $mensajen"
  26. ."n";
  27.  
  28. $response = $_POST["g-recaptcha-response"];
  29. $url = 'https://www.google.com/recaptcha/api/siteverify';
  30. $data = array(
  31. 'secret' => 'MI CLAVE SECRETA',
  32. 'response' => $_POST["g-recaptcha-response"]
  33. );
  34. $options = array(
  35. 'http' => array (
  36. 'method' => 'POST',
  37. 'content' => http_build_query($data)
  38. )
  39. );
  40. $context = stream_context_create($options);
  41. $verify = file_get_contents($url, false, $context);
  42. $captcha_success=json_decode($verify);
  43. if ($captcha_success->success==false) {
  44. echo "<p>You are a bot! Go away!</p>";
  45. } else if ($captcha_success->success==true) {
  46. echo "<p>You are not not a bot!</p>";
  47. }
  48. ?>
Add Comment
Please, Sign In to add comment