-correo electronico, quisiera ver cual es la funcion para que mi formulario valide si el correo que se anoto existe.
- y quiero que al hacer clic en submit me tiene que salir un pop-up que diga si el mensaje se ah enviado, o el correo esta mal escrito.
- y que mi formulario tenga la opcion de autorespuesta, digamos que me llegue un correo con los datos que acabo de ingresar en el fomulario.
les anexo el codigo html y php:
HTML:
Código HTML:
Ver original
<form name="cursocolima" method="POST" action="procesar.php" target="_blank"> <table width="450px"> <tr> </tr> <tr> <td valign="top"> </td> <td valign="top"> <input type="text" name="nombre" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"> <input type="text" name="edad" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"> <input type="text" name="ocupacion" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"> <input type="text" name="email" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"> <input type="text" name="curso" maxlength="30" size="30"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <!-- Estamos muy agradecidos a usted para mantener este vínculo en su sitio. gracias. --> </tr> </table> </form>
PHP:
Código PHP:
Ver original
<?php // CHANGE THE TWO LINES BELOW $email_subject = "Cursos ICADEP enviado por $nombre: ".$_POST["curso"] ; function died($error) { // your error code can go here echo "Lo sentimos, pero hay errores encontrados con la forma que ha enviado.<br /><br />"; echo $error."<br /><br />"; echo "Por favor, vuelva atras y corrija estos errores.<br /><br />"; } // validation expected data exists died('Lo sentimos, pero parece ser un problema con la forma que ha enviado.'); } $nombre = $_POST['nombre']; // required $edad = $_POST['edad']; // required $ocupacion = $_POST['ocupacion']; // required $email_from = $_POST['email']; // required $curso = $_POST['curso']; // not required $mensaje = $_POST['mensaje']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; $error_message .= 'La direccion de correo electronico que has introducido no parece ser valido.<br />'; } died($error_message); } $email_message = "Formar formulario.\n\n"; function clean_string($string) { } $email_message .= "nombre: ".clean_string($nombre)."\n"; $email_message .= "edad: ".clean_string($edad)."\n"; $email_message .= "ocupacion: ".clean_string($ocupacion)."\n"; $email_message .= "email: ".clean_string($email_from)."\n"; $email_message .= "curso: ".clean_string($curso)."\n"; $email_message .= "mensaje: ".clean_string($mensaje)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . ?> <!-- place your own success html below --> Gracias por contactar con nosotros. Nos pondremos en contacto con usted muy pronto. <?php } ?>