Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] Envío de formulario por php

Estas en el tema de Envío de formulario por php en el foro de PHP en Foros del Web. Hola, estaba creando un formulario y quería que los datos se envíen al correo pero no sé que sucede y no me funciona, he intentado ...
  #1 (permalink)  
Antiguo 26/09/2015, 00:38
 
Fecha de Ingreso: julio-2015
Mensajes: 20
Antigüedad: 8 años, 8 meses
Puntos: 0
Pregunta Envío de formulario por php

Hola, estaba creando un formulario y quería que los datos se envíen al correo pero no sé que sucede y no me funciona, he intentado de todo pero no he podido, espero su ayuda. Este es el formulario:

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html lang="es-Es" xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  4. <title>Registro</title>
  5. <link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
  6. <link href='http://fonts.googleapis.com/css?family=Indie+Flower' rel='stylesheet' type='text/css'>
  7. <link href='http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'>
  8. <style type="text/css">
  9.  
  10.     body {
  11.         background:url(fondo.jpg) no-repeat fixed center;
  12.         background-position:center;
  13.     }
  14.     form {
  15.         background:#333333;
  16.         width:360px;
  17.         border:1px solid #4e4d4d;
  18.         border-radius:3px;
  19.         -moz-border-radius:3px;
  20.         -webkit-border-radius:3px;
  21.         margin:100px auto;
  22.     }
  23.     form h1 {
  24.         text-align: center;
  25.         color: #ffffff;
  26.         font-weight:black;
  27.         font-size:18pt;
  28.         margin-left: 0px;
  29.         margin-right: 30px;
  30.         margin-top: 15px;
  31.         margin-bottom: -40px;
  32.         font-family: 'Rock Salt', cursive;
  33.     }
  34.     form input{
  35.         width:280px;
  36.         height:35px;
  37.         padding:0px 10px;
  38.         color:#6d6d6d;
  39.         margin-top:10px;
  40.         margin-bottom:5px;
  41.         font-family: 'Reenie Beanie', cursive;
  42.         font-size: 17pt;
  43.     }
  44.     form label{
  45.         width:280px;
  46.         height:35px;
  47.         padding:0px 0px;
  48.         color:#ffffff;
  49.         text-align:center;
  50.         font-family: 'Indie Flower', cursive;
  51.     }
  52.     form button{
  53.         width: 135px;
  54.         margin-top:5px;
  55.         height:50px;
  56.         border:1px solid #232323;
  57.         color: %fff;
  58.         box-shadow: 0px 2px 0px #000;
  59.         -moz-box-shadow: 0px 2px 0px #000;
  60.         -webkit-box-shadow: 0px 2px 0px #000;
  61.         border-radius: 3px;
  62.         -moz.border-radius: 3px;
  63.         -webkit-border-radius: 3px;
  64.     }
  65.     form button:hover{
  66.         background:#B2B2B2;
  67.     }
  68.     form button:active{
  69.         background: #F9F9F9;
  70.     }
  71. </head>
  72.  
  73. <form method="post" action="miformu.php">
  74.     <ul>      
  75.             <h1><b> Registrese para mantenerse en contacto con nosotros</b><br /></h1><br />
  76.        
  77.        <br />
  78.            <label for="name">Primer nombre:</label>
  79.            <input type="text" name="nombre" placeholder="Ejm: Giancarlo" required />
  80.        
  81.        <br />
  82.            <label for="name">Segundo nombre:</label>
  83.            <input type="text" name="nombredos" placeholder="(Opcional)" />
  84.        
  85.        <br />
  86.            <label for="text">Apellidos:</label>
  87.            <input type="text" name="apellidos" placeholder="Ejm: Rosero Portillo" required />
  88.        
  89.        <br />
  90.            <label for="date">Fecha de nacimiento:</label>
  91.            <input type="date" name="nacimiento" name="nacimiento" required />
  92.          
  93.        <br />
  94.            <label for="email">Email:</label>
  95.        <br />
  96.            <input type="email" name="email" placeholder="Ejm: [email protected]" required />
  97.        
  98.        <br />
  99.            <label for="name">Ingrese un nombre de usuario:</label>
  100.            <input type="text" name="usuario" placeholder="Nombre de usuario" required />
  101.  
  102.        <br />
  103.            <label for="name">Ingrese una contraseña:</label>
  104.            <input type="password" name="clave" required />            
  105.        
  106.        <br />
  107.            <label for="Mensaje">Mensaje:</label> <br />
  108.            <textarea name="Mensaje" name="opinion" placeholder="Escribenos tu opinión:" cols="40" rows="6"></textarea>
  109.        
  110.         <br />
  111.           <input type="submit" value="enviar" id="boton">
  112.        
  113.     </ul>
  114. </form>
  115. </body>
  116. </html>

El cual redirige a la sig. página: [URL="http://creacioninternetgian.site90.net/"]http://creacioninternetgian.site90.net/[/URL]

Y en el php tengo esto:

Código PHP:
Ver original
  1. <?php
  2. $destino= "[email protected]";
  3.  
  4. $nombre=$_POST["nombre"];
  5. $nombredos=$_POST["nombredos"];
  6. $apellidos=$_POST["apellidos"];
  7. $nacimiento=$_POST["nacimiento"];
  8. $correo=$_POST["correo"];
  9. $usuario=$_POST["usuario"];
  10. $clave=$_POST["clave"];
  11. $opinion=$_POST["opinion"];
  12. $contenido= "Nombre: " .$nombre. "\nnombredos" .$nombredos. "\nApellidos: " .$apellidos. "\nNacimiento: " ."\nCorreo: " .$correo. "\nUsuario: " .$usuario. "\nClave: " .$clave. "\nOpinion: " .$opinion;
  13. mail($destino, "Mensaje de prueba", $contenido);
  14. echo "Se envió el mensaje";
  15. ?>

Según todo y eso sale que se ha enviado; pero NO LLEGA NADA
espero me ayuden, gracias
  #2 (permalink)  
Antiguo 28/09/2015, 08:57
Avatar de JoshMex
Moderador Webhosting
 
Fecha de Ingreso: enero-2006
Mensajes: 4.057
Antigüedad: 18 años, 2 meses
Puntos: 166
Respuesta: Envío de formulario por php

Evita usar la función mail() de php, envía los emails autenticados por smtp, usa phpmailer
__________________
JoshMex
Desarrollador Plataforma Microsoft / Windows / ASP / ASP.NET / SQL Server
Es inútil hacer cualquier cosa a prueba de tontos, porque los tontos son muy ingeniosos

Etiquetas: ayuda-general, correo, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:16.