Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/06/2008, 16:03
nightduke
 
Fecha de Ingreso: mayo-2008
Mensajes: 181
Antigüedad: 16 años
Puntos: 0
formulario con recaptcha

Tengo este codigo de formulario pero me da error...
Esta en el final del mensaje.
¿Alguien me puede decir porque esta fallando?
Gracias


<html>
<body>
<form action="" method="post">
<?php
require_once('recaptchalib.php');
$captcha_publickey = "6Lc_EwIAAAAAABnIgVhYOjjc_OceQo4kV";
$captcha_privatekey = "6Lc_EwIAAAAAADzTqD0tvUZ9bxyu7dqh4";
# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$erro = null;


#are we submitting the page?
if ($_POST["submit"]) {
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
echo "You got it!";
# in a real application, you should send an email, create an account,
etc
} else {
# set the error code so that we can display it. You could also use
# die ("reCAPTCHA failed"), but using the error message is
# more user friendly
$error = $resp->error;
}
}
echo recaptcha_get_html($publickey, $error);
?>
<br/>
<input type="submit" name="submit"
value="submit" />
</form>
</body>
</html>



is_valid) { echo "You got it!"; # in a real application, you should
send an email, create an account, etc } else { # set the error code so
that we can display it. You could also use # die ("reCAPTCHA failed"),
but using the error message is # more user friendly $error = $resp-



>error; } } echo recaptcha_get_html($publickey, $error); ?>