Tema: Captcha
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/06/2011, 18:39
Avatar de Webs_DS
Webs_DS
 
Fecha de Ingreso: diciembre-2010
Ubicación: España
Mensajes: 62
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: Captcha

sip,, sorry:



este es mi codigo del formulario principal

<form id="form1" name="form1" method="get" action="enviacorreo.php">
<p>
Nombre<br />
<input name="nombre" type="text" id="nombre" size="36" class=":min_length;3 :required"/>
</p>

<p>
Email:<br />
<input name="email" type="text" id="email" size="36" class=":email :required" />
</p>

<p>
Comentarios;<br />
<textarea name="comentarios" rows="8" cols="61" wrap="soft" class=":min_length;10 :required"></TEXTAREA>
</p>


<p>
<input type="submit" name="btsend" id="btsend" value="Registro" />
</p>
</form>


Y este es del captcha:
<?php
session_start();

if ($_POST['action'] == "checkdata") {
echo $_SESSION['tmptxt'] . "<br>";
echo $_POST['tmptxt'] . "<br>";

if ($_SESSION['tmptxt'] == $_POST['tmptxt']) {
$status = 1;
} else {
$errorCaptcha = "error";
}
}
?>
<html>
<head>
<link href="css/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="wrapper">
<div class="section">
<div id="login">
<h1>Captcha con PHP</h1>
<?php if($status != 1){ ?>
<form id="form1" action="captchademo.php" method="post">
<label for="username">Ingresa el texto mostrado en la imagen</label>
<input tabindex="1" name="tmptxt" id="username" type="text" class="text <?php if ($errorCaptcha == "error"){ echo "error";} ?>" ><br>
<img src="captcha.php" width="100" height="40">
<input name="action" type="hidden" value="checkdata"><br>
<input type="submit" class="boton" value="Validar texto" style="cursor:hand">

</form>
</div>
<?php }else
echo "Texto introducido correctamente";
?>
</div>
</div>




Quiero hacer solo uno y que al darle "enviar" valide cada campo y tambien el captcha si esta bien ..
Gracias..