Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src='https://www.google.com/recaptcha/api.js?hl=es'></script>
- </head>
- <div class="g-recaptcha" data-sitekey="6LdOPUEUAAAAAHDrxcTX40LZ-y9vi6INu6wLEaU2"></div>
- <button type="submit" class="btn btn-skin pull-right" id="btnContactUs">Enviar</button>
- <?php
- //Variables del formulario de contacto
- @$nombre = addslashes($_POST['nombre']);
- @$email = addslashes($_POST['email']);
- @$contenido = addslashes($_POST['contenido']);
- @$mensaje = addslashes($_POST['mensaje']);
- //Mensaje de contacto
- $cabeceras = "From: Renovaburgos"
- . ": $email";
- $asunto = "Mensaje desde la pagina Web";
- $email_to = "info@academiafuture.com";
- $contenido = "$contenido"
- ."n"
- . "Nombre: $nombren"
- . "Email: $emailn"
- . "Contenido: $contenidon"
- . "Mensaje: $mensajen"
- ."n";
- $response = $_POST["g-recaptcha-response"];
- $url = 'https://www.google.com/recaptcha/api/siteverify';
- $data = array(
- 'secret' => 'MI CLAVE SECRETA',
- 'response' => $_POST["g-recaptcha-response"]
- );
- $options = array(
- 'http' => array (
- 'method' => 'POST',
- 'content' => http_build_query($data)
- )
- );
- $context = stream_context_create($options);
- $verify = file_get_contents($url, false, $context);
- $captcha_success=json_decode($verify);
- if ($captcha_success->success==false) {
- echo "<p>You are a bot! Go away!</p>";
- } else if ($captcha_success->success==true) {
- echo "<p>You are not not a bot!</p>";
- }
- ?>
Add Comment
Please, Sign In to add comment