Foros del Web » Programando para Internet » PHP »

Problema con la funcion mail, Ayudenme!!!

Estas en el tema de Problema con la funcion mail, Ayudenme!!! en el foro de PHP en Foros del Web. Buenos Dias, Tengo una problema con la funcion mail , El problema es que si en el form dejo espacios en blanco automaticamente solo envia ...
  #1 (permalink)  
Antiguo 13/04/2004, 07:19
 
Fecha de Ingreso: abril-2004
Ubicación: Caracas
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
Pregunta Problema con la funcion mail, Ayudenme!!!

Buenos Dias, Tengo una problema con la funcion mail ,
El problema es que si en el form dejo espacios en blanco automaticamente solo envia lo que leyo antes de dicho espacio.
ejemplo:
si coloco "La Casa es bonita" solo envia al mail "La" el resto de la oracion no la toma en cuenta, asi pasa con todas las casillas del form que estoy utilizando.


tengo dos archivos, uno que se llama paso2 y otro que se llama completado.

el archibo completado tiene la funcion mail, este es el codigo:

<?php

$agregar =" Modalidad: ".$_POST['opcion']."
Nombre: ".$_POST['Nombre']."
Apellido: ".$_POST['Apellido']."
Cedula: ".$_POST['CI']."
Direccion: ".$_POST['direccion']."
Telefono Oficina: ".$_POST['oficina']."
Telefono Hab.: ".$_POST['hab']."
Telefono Celular: ".$_POST['celular']."
Telefono Fax: ".$_POST['fax']."
Email: ".$_POST['email']."
Como ayudar?: ".$_POST['ayuda']." ";

mail("[email protected]", "NUEVO ".$_POST['opcion'].": ".$_POST['Nombre']." ".$_POST['Apellido']." ", $agregar);

echo ' SU SOLICITUD A SIDO ENVIADA CON EXITO, HAGA CLICK <a href="h02.htm">AQUI</a> PARA VOLVER';


?>

y el archivo paso tiene este codigo:

<table width="75%">
<!--DWLayoutTable-->
<tr>
<td width="117" height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Nombre</font></td>
<td valign="top"><?php echo $_POST['Nombre'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Apellido</font></td>
<td valign="top"><?php echo $_POST['Apellido'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">C.I.</font></td>
<td valign="top"><?php echo $_POST['CI'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Direccion</font></td>
<td valign="top"><?php echo $_POST['direccion'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Oficina</font></td>
<td valign="top"><?php echo $_POST['oficina'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Habitacion</font></td>
<td valign="top"><?php echo $_POST['hab'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef
Celular</font></td>
<td valign="top"><?php echo $_POST['celular'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Fax</font></td>
<td valign="top"><?php echo $_POST['fax'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Email</font></td>
<td valign="top"><?php echo $_POST['email'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Ayuda</font></td>
<td valign="top"><?php echo $_POST['ayuda'];?>&nbsp;</td>
</tr>
<tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Modalidad</font></td>
<td valign="top"><?php echo $_POST['opcion'];?>&nbsp;</td>
</tr>
<tr>
<td height="35" valign="top"> <div align="right"> </div></td>
<td valign="top"> <div align="left">
<input type="submit" name="Aceptar" value="Registrar">
</div></td>
</tr>
</table>


De verdad necesito ayuda, necesito saber donde esta el problema
gracias de ante Mano

mi email es [email protected]

Juan_Vzla
  #2 (permalink)  
Antiguo 13/04/2004, 07:23
Ex Colaborador
 
Fecha de Ingreso: junio-2002
Mensajes: 9.091
Antigüedad: 21 años, 10 meses
Puntos: 16
Hola,

Creo que el fallo esta en la parte del formulario que no pones, la de los campos ocultos. Recuerda que en el HTML generado los value de los hidden deben ir entre comillas, sino el HTML solo toma hasta el primer espacio como value. No es un problema de PHP, sino de HTML.

Saludos.

PD: ¿Acerte?
__________________
Josemi

Aprendiz de mucho, maestro de poco.
  #3 (permalink)  
Antiguo 13/04/2004, 07:41
 
Fecha de Ingreso: abril-2004
Ubicación: Caracas
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
Hola Josemi, gracias por ayudarme, ya estoy tan tapao con este procedimiento que ya ni veo q es lo que me dices, este es el codigo de html donde esta el formulario

<p><center>
<form name="form1" method="post" action="paso2.php">
<table width="75%" border="1">
<!--DWLayoutTable-->
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Modalidad</font></td>
<td valign="top"><select name="opcion">
<option>Voluntario</option>
<option>Amigo</option>
<option>Padrino</option>
</select></td>
</tr>
<tr>
<td width="117" height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Nombre</font></td>
<td valign="top"><input type="text" name="Nombre"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Apellido</font></td>
<td valign="top"><input type="text" name="Apellido"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">C.I.</font></td>
<td valign="top"><input type="text" name="CI"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Direccion</font></td>
<td valign="top"><textarea name="direccion" rows="3" cols="70"></textarea></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Oficina</font></td>
<td valign="top"><input type="text" name="oficina"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Habitacion</font></td>
<td valign="top"><input type="text" name="hab"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef
Celular</font></td>
<td valign="top"><input type="text" name="celular"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Fax</font></td>
<td valign="top"><input type="text" name="fax"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Email</font></td>
<td valign="top"><input type="text" name="email" size="50"></td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Ayuda</font></td>
<td valign="top"><textarea name="ayuda" cols="70" rows="5"></textarea></td>
</tr>
<tr>
<td height="22" valign="top"><input type="submit" name="Aceptar" value="Aceptar"></td>
<td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
</table>
</form>
</center>

dime si es aqui que consideras que esta el error!!, gracias Nuevamente!!

Juan_Vzla
  #4 (permalink)  
Antiguo 13/04/2004, 08:48
Ex Colaborador
 
Fecha de Ingreso: junio-2002
Mensajes: 9.091
Antigüedad: 21 años, 10 meses
Puntos: 16
No, es en paso2.php donde debe estar mal (la pagina que llama a la que envia el email).

Saludos.
__________________
Josemi

Aprendiz de mucho, maestro de poco.
  #5 (permalink)  
Antiguo 13/04/2004, 09:45
 
Fecha de Ingreso: abril-2004
Ubicación: Caracas
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
esto es lo que tengo en paso 2, disculpa que te moleste tanto, crees que sea aqui?

<form name="form1" method="post" action="completado.php">
<table width="75%">
<!--DWLayoutTable-->
<tr>
<td width="117" height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Nombre</font></td>
<td valign="top"><?php echo $_POST['Nombre'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Apellido</font></td>
<td valign="top"><?php echo $_POST['Apellido'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">C.I.</font></td>
<td valign="top"><?php echo $_POST['CI'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Direccion</font></td>
<td valign="top"><?php echo $_POST['direccion'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Oficina</font></td>
<td valign="top"><?php echo $_POST['oficina'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Habitacion</font></td>
<td valign="top"><?php echo $_POST['hab'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef
Celular</font></td>
<td valign="top"><?php echo $_POST['celular'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Telef.
Fax</font></td>
<td valign="top"><?php echo $_POST['fax'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Email</font></td>
<td valign="top"><?php echo $_POST['email'];?>&nbsp;</td>
</tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Ayuda</font></td>
<td valign="top"><?php echo $_POST['ayuda'];?>&nbsp;</td>
</tr>
<tr>
<tr>
<td height="22" valign="top"><font size="2" face="Courier New, Courier, mono">Modalidad</font></td>
<td valign="top"><?php echo $_POST['opcion'];?>&nbsp;</td>
</tr>
<tr>
<td height="35" valign="top"> <div align="right"> </div></td>
<td valign="top"> <div align="left">
<input type="submit" name="Aceptar" value="Registrar">
</div></td>
</tr>
</table>
<?php echo "<input name="."Nombre". " type="."hidden"." value=". $_POST['Nombre'] ."> ";?>
<?php echo "<input name="."Apellido". " type="."hidden"." value=". $_POST['Apellido'] ."> ";?>
<?php echo "<input name="."CI". " type="."hidden"." value=". $_POST['CI'] ."> ";?>
<?php echo "<input name="."direccion". " type="."hidden"." value=". $_POST['direccion'] ."> ";?>
<?php echo "<input name="."oficina". " type="."hidden"." value=". $_POST['oficina'] ."> ";?>
<?php echo "<input name="."hab". " type="."hidden"." value=". $_POST['hab'] ."> ";?>
<?php echo "<input name="."celular". " type="."hidden"." value=". $_POST['celular'] ."> ";?>
<?php echo "<input name="."fax". " type="."hidden"." value=". $_POST['fax'] ."> ";?>
<?php echo "<input name="."email". " type="."hidden"." value=". $_POST['email'] ."> ";?>
<?php echo "<input name="."ayuda". " type="."hidden"." value=". $_POST['ayuda'] ."> ";?>
<?php echo "<input name="."opcion". " type="."hidden"." value=". $_POST['opcion'] ."> ";?>
</form>

gracias

Juan_Vzla
  #6 (permalink)  
Antiguo 13/04/2004, 09:50
Ex Colaborador
 
Fecha de Ingreso: junio-2002
Mensajes: 9.091
Antigüedad: 21 años, 10 meses
Puntos: 16
Si, como me imaginaba. El problema es que estas lineas:
Código PHP:
 <?php echo "<input name="."Nombre"" type="."hidden"." value="$_POST['Nombre'] ."> ";?>
generan este HTML:

<input name=Nombre type=hidden value=La Casa es bonita>

Y este HTML lo que hace es decir que value=La. El resto es basura. Para que lo tome en cuenta el HTML generado tiene que tener comillas:
Código PHP:
 <?php echo "<input name=\"Nombre\" type=\"hidden\" value=\"".$_POST['Nombre']."\"> ";?>
Lo mismo para el resto de hidden.

En http://www.php.net/manual/en/language.types.string.php tienes mas info sobre meter comillas en cadenas.

Suerte.
__________________
Josemi

Aprendiz de mucho, maestro de poco.
  #7 (permalink)  
Antiguo 13/04/2004, 11:30
 
Fecha de Ingreso: abril-2004
Ubicación: Caracas
Mensajes: 4
Antigüedad: 20 años
Puntos: 0
Muchas Gracias Josemi, eso soluciono mi problema, no tienes idea de todas las veces que le pase por encima a esa parte del codigo cuando estaba buscando el posible error (y)
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 20:16.