realizo submit empleando este código
Código HTML:
Ver original<!DOCTYPE html>
<title>How to Integrate Google “No CAPTCHA reCAPTCHA” on Your Website
</title> <script src='https://www.google.com/recaptcha/api.js'></script>
<?php
// coge la librería recaptcha
require_once "../recaptchalib.php";
// tu clave secreta
$secret = "6LczFCkTAAAAAM96ZErJbB-l1Wv_c2e8NX1067wH";
// respuesta vacía
$response = null;
// comprueba la clave secreta
$reCaptcha = new ReCaptcha($secret);
// si se detecta la respuesta como enviada
if ($_POST["g-recaptcha-response"]) {
$response = $reCaptcha->verifyResponse(
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
?>
<?php
// assemble the message from the POST fields
// getting the captcha
$captcha = '';
if (isset($_POST['g-recaptcha-response']))
$captcha = $_POST['g-recaptcha-response'];
echo 'captcha: '.$captcha;
if (!$captcha)
echo 'The captcha has not been checked.';
// handling the captcha and checking if it's ok
$secret = 'XXXXXXXXXXXXXXXXXXwH';
$response = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret."&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
var_dump($response);
// if the captcha is cleared with google, send datos and echo ok.
if ($response['success'] != false) {
// send datos
location.href='1f_ok.php'</script>";
// the echo goes back to the ajax, so the user can know if everything is ok
echo 'ok';
} else {
echo 'not ok';
}
?>
<form action="" method="post" enctype="multipart/form-data" name="procedim" onSubmit="MM_validateForm('nombre','mailcontacto');return document.MM_returnValue" ondblclick="Submit_seguro(this)">
<input name="nombre" required><br />
<input name="mailcontacto" type="email" required><br />
<div class="g-recaptcha" data-sitekey="XXXXXXXXXXXJoC"></div>
<input type="submit" value="Submit" />
<script src='https://www.google.com/recaptcha/api.js'></script>
<?php
foreach ($_POST as $key => $value) {
}
?>
<?php } ?>
me da error " Parse error: syntax error, unexpected '=' in /homepages/ " concretamente en
Código HTML:
Ver original// if the captcha is cleared with google, send datos and echo ok.
if ($response['success'] != false) {