Título: formulario llega en blanco Publicado por: mhroth en 16 Septiembre 2013, 17:12 pm tengo un formulario html y php que me llega en blanco y no me aclaro porque
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Language" content="es" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Solicitud de Admision</title> <style type="text/css"> .top { border: 5px solid #800000; background-color: #FFFF99; font-family: Arial; font-size: xx-large; font-weight: bold; text-align: center; color: blue; } .div { margin: .4em 0; margin-left: 30px; font-family: Arial; font-size: medium; } .div label { width: 10%; float: left; } .style1 { font-size: small; color: blue; margin-left: 30px; } .enviar { border:thick; padding-left: 150px; padding-top: 5px; } .style3 { padding-left: 30px; font-family: Arial; font-size: x-large; color: black; } .style4 { color: navy; font-size: xx-large; margin-left: 30px; } .style5 { text-decoration: underline; margin-left: 40px; } </style> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <link rel="stylesheet" type="text/css" href="css/reset.css"/> <script type="text/javascript" src="js/modernizr.js"></script> </head> <body style=" background-color: #FFCC99"> <form action="enviar.php" method="post"/> <span class="style4"><strong> <img src="images/varios/logo%20club.png" alt="logo" width="75" height="100" /> CANCELADAGOLF<br /> <br /> </strong></span><p class="style3"> <strong><span class="style5">SOLICITUD DE ADMISION</span></strong></p> <p class="style3"> </p> <div class="div"> <label for="nombre">Nombre:</label> <input type="text" id="nombre" /> </div> <div class="div"> <label for="apellidos">Apellidos:</label> <input type="text" id="apellidos" size="35" /> </div> <div class="div"> <label for="direccion">Dirección:</label> <input type="text" id="direccion" size="35" /> </div> <div class="div"> <label for="cod.postal">Cod.postal:</label> <input type="text" id="cod.postal" size="10" /> </div> <div class="div"> <label for="poblacion">Población:</label> <input type="text" id="poblacion" size="35" /> </div> <div class="div"> <label for="nif/nie">Nif/Nie:</label> <input type="text" id="nif/nie" size="15" /> </div> <div class="div"> <label for="nacido_el">Nacido el:</label> <input type="text" id="nacido_el" size="15" /> </div> <div class="div"> <label for="tel.movil">Tel. móvil:</label> <input type="text" id="tel. movil" size="15" /> </div> <div class="div"> <label for="email">Email:</label> <input type="text" id="email" size="35" /> </div> <div class="div"> <label for="no_licencia">Nº Licencia:</label> <input type="text" id="no_licencia" size="15" /> </div> <div class="div"> <label for="handicap">Handicap</label> <input type="text" id="handicap" size="5" /> </div> <div class="div"> <label for="cta.bancaria">Cta. bancaria:</label> <input type="text" id="cta.bancaria" size="25" /> </div> <div class="div"> <label for="fecha">Fecha:</label> <input type="text" id="fecha" size="15" /> </div> <br /> <br /> <span class="style1"><em>EL SOLICITANTE, AL ENVIAR LA SOLICITUD, SE DECLARA<br /> CONFORME CON LAS REGLAS Y LOS ESTATUTOS DEL CLUB</em></span> <p class="enviar"> <input type="submit" id="submit" value="enviar"/> </p> </body> </html> el php: <?php; $nombre = $_POST["nombre"]; $apellidos = $_POST["apellidos"]; $direccion = $_POST["direccion"]; $cod_postal = $_POST["cod_postal"]; $poblacion = $_POST["poblacion"]; $nif_nie = $_POST["nif_nie"]; $nacido_el = $_POST["nacido_el"]; $tel_movil = $_POST["tel_movil"]; $no_licencia = $_POST["no_licencia"]; $handicap = $_POST["handicap"]; $cta_bancaria = $_POST["cta_bancaria"]; $fecha = $_POST["fecha"]; $header = "From:" .$email."\r\n"; $header .= "X-Mailer: PHP/" .phpversion(). "\r\n"; $header .= "Mime-Version: 1.0 \r\n"; $mensaje = "Este mensaje fue enviado por:" .$email. "\r\n"; $mensaje .= "Nombre: ".$nombre."\r\n"; $mensaje .= "Apellidos: ".$apellidos."\r\n"; $mensaje .= "Dirección: ".$direccion."\r\n"; $mensaje .= "Cod.postal: ".$cod_postal."\r\n"; $mensaje .= "Población: ".$poblacion."\r\n"; $mensaje .= "Nif/Nie : ".$nif_nie."\r\n"; $mensaje .= "Nacido el: ".$nacido_el."\r\n"; $mensaje .= "Tel.móvil: ".$tel_movil."\r\n"; $mensaje .= "Licencia: ".$no_licencia."\r\n"; $mensaje .= "Handicap: ".$handicap."\r\n"; $mensaje .= "Cta.bancaria: ".$cta_bancaria."\r\n"; $mensaje .= "Fecha: ".$fecha."\r\n"; $para = "info@canceladagolf.com"; $asunto = "Solicitud"; mail($para, $asunto, utf8_decode($mensaje), $header); echo "mensaje enviado correctamente. Bienvenido a CANCELADAGOLF"; ?> ¿hay alguien que me puede echar una mano? gracias Título: Re: formulario llega en blanco Publicado por: basickdagger en 18 Septiembre 2013, 20:49 pm post de php recibe el name de tu formulario no el ID... solo agregale a tus campos el mismo nombre d etu id pero con name y listo ej...
Código: //tu lo tienes asi... saludos!! Título: Re: formulario llega en blanco Publicado por: mhroth en 19 Septiembre 2013, 17:48 pm muchas gracias por tu atención. Lo he cambiado como tu has sugerido y funciona perfectamente.
gracias otra vez, campeon |