![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/02/2009, 11:16
|
![Avatar de djsos](http://static.forosdelweb.com/customavatars/avatar195081_1.gif) | | | Fecha de Ingreso: septiembre-2007 Ubicación: Madrid-España
Mensajes: 374
Antigüedad: 17 años, 5 meses Puntos: 14 | |
Respuesta: Alguien me podria ayudar con un formulario simple? mira haber si te sirve esto: Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Enviar un email a varios destinos</title> </head>
<body> <form id="enviar_mail" name="enviar_mail" method="post" action="mail.php?send=ok"> <p>Nombre: <input name="nmbre" type="text" id="nmbre" /> </p> <p>Telefono: <input name="tlf" type="text" id="tlf" /> </p> <p>Email: <input name="email" type="text" id="email" /> </p> <p>Informacion: <textarea name="inf" id="inf"></textarea> </p> <p>Destino <select name="des" id="des"> <option value="[email protected]">Presidente</option> <option value="[email protected]">Oficina</option> <option value="[email protected]">Tesoreria</option> <option value="[email protected]">Subdirector</option> <option value="0" selected="selected">Seleccion el destino</option> </select> </p> <p> <input type="submit" name="Submit" value="Enviar" /> <input type="reset" name="Submit2" value="Vaciar" /> </p> </form> <p> <?php if($_GET['send'] == "ok"){
$nmbre = $_POST['nmbre']; $tlf = $_POST['tlf']; $correo = $_POST['email']; $inf = $_POST['inf']; $des = $_POST['des'];
if($des == "0"){ echo "Selecciona un destino para el mensaje"; exit; } $sbject = "$nmbre te ha enviado un mensaje"; $mail = "El mensaje ha sido enviado por $nmbre<br /> <br /> El telefono de $nmbre es $tlf<br /> <br /> Mensaje:<br /> <br /> $inf<br /> <br />
Responderle a $correo"; mail($correo,$sbject,$mail); echo "Hola $nmbre, tu mensaje a sido enviado<br /> Mensaje enviado:<br /> $mail"; } ?> </p> </body> </html> |