Foros del Web » Programando para Internet » PHP »

Enviar datos de un form (PHP) a un e-mail

Estas en el tema de Enviar datos de un form (PHP) a un e-mail en el foro de PHP en Foros del Web. les adjunto el codigo de mi pagina, necesito tomar los datos del formulario y re enviarlos a una dirección de e-mail. desde ya gracias y ...
  #1 (permalink)  
Antiguo 12/05/2005, 08:56
 
Fecha de Ingreso: marzo-2005
Mensajes: 90
Antigüedad: 19 años, 1 mes
Puntos: 0
Enviar datos de un form (PHP) a un e-mail

les adjunto el codigo de mi pagina, necesito tomar los datos del formulario y re enviarlos a una dirección de e-mail.
desde ya gracias y sds.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../karaoke.css" rel="stylesheet" type="text/css">

<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<script language="JavaScript" src="validaciones.js"></script>
<script language="javascript">

function validoYear(ano){
if(!validoNumerico(ano) || ano.value<1900) return false;
return true;
}
function validar(f)
{
if (!validoTexto(f.nombre))
return error("Por favor ingrese su nombre. Muchas gracias.", f.nombre);

if (!validoEmail(f.email))
return error("Por favor ingrese una direccion de e-mail válida. Muchas gracias.", f.email);

if (!validoTexto(f.dia))
return error("Por favor ingrese su fecha de nacimiento.", f.dia);

if (!validoTexto(f.mes))
return error("Por favor ingrese su fecha de nacimiento.", f.mes);

if (!validoYear(f.anio))
return error("Por favor ingrese una fecha de nacimiento válida.", f.anio);

if (!validoEdad(f.dia,f.mes,f.anio)) {
location.href = "ingreso.php\?edad=menor";
//return error("Para inscribirte debes ser mayor de 18 años.", f.anio);
return false;
}
}

</script>
<title></title>
</head>
<body bgcolor="#002188" style="margin:0px">
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td height="65" bgcolor="#00C8EC">&nbsp;</td>
</tr>
<tr>
<td align="center" height="481" background="imagenes/fondo_degrade.gif"> <table width="320" cellpadding="0" cellspacing="0">
<tr>
<td background="imagenes/ingreso_fondo.gif">&nbsp;</td>
</tr>
<tr>
<td background="imagenes/ingreso_fondo.gif">&nbsp;</td>
</tr>
<tr>
<td background="imagenes/ingreso_fondo.gif" class="texto1">
<b><br>
Est&aacute;s en la P&aacute;gina Web de Nevada. </b><br>
Para ingresar te pedimos que escribas:<br>
<br>
<form action="index.php" method="post" name="ingreso" id="ingreso" onSubmit="return validar(this);">
<table width="100%" border="0">
<tr>
<td class="texto12Blanco" align="right" >* nombre</td>
<td colspan="2"><input type="text" name="nombre" width="160" value=""></td>
</tr>
<tr>
<td class="texto12Blanco" align="right">* e-mail</td>
<td colspan="2"><input type="text" name="email" width="160" value=""></td>
</tr>
<tr>
<td colspan="3" class="texto12Blanco" style="padding:12px 0px 5px 0px; text-align: center;">fecha de nacimiento</td>
</tr>
<tr>
<td colspan="3" align="center"><table border="0">
<tr>
<td class="texto12Blanco" >* d&iacute;a</td>
<td><input name="dia" type="text" style="width:25px" maxlength="2" value=""></td>
<td class="texto12Blanco">* mes</td>
<td><input name="mes" type="text" style="width:25px" maxlength="2" value=""></td>
<td class="texto12Blanco">* a&ntilde;o </td>
<td class="textochico2"><!--19--></td>
<td><input name="anio" type="text" style="width:40px" maxlength="4" value=""></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan=3 align="center" style="padding: 10px 0px ; "><input name="imageField" type="image" src="imagenes/ingreso_boton.gif" width="148" height="39" border="0"> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td background="imagenes/proximamente_pie.gif" class="textochico3" style="background-position: bottom;"><div style="background-color: #FFFFFF; line-height: 12px; margin: 2px 5px 5px 5px; color: #000000; padding: 0 2px;"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#0066C9">&nbsp;</td>
</tr>
</table>
</body>

<script language="JavaScript">
<!--

window.open = SymRealWinOpen;

//-->
</script>

</html>
  #2 (permalink)  
Antiguo 12/05/2005, 09:01
Avatar de dwaks  
Fecha de Ingreso: agosto-2002
Ubicación: Panamá
Mensajes: 962
Antigüedad: 21 años, 8 meses
Puntos: 15
aqui dicen:
http://www.forosdelweb.com/showthrea...380#post447380
  #3 (permalink)  
Antiguo 12/05/2005, 09:05
Avatar de maralbust  
Fecha de Ingreso: febrero-2004
Ubicación: Santiago
Mensajes: 578
Antigüedad: 20 años, 2 meses
Puntos: 0
mira esto y moficalo a tu antojo


correo.php
Código PHP:
 <?
if (!$HTTP_POST_VARS){
?>
        </p>
        <form name="enviar" action="contact.php" method="post">
  <div align="center">
    <br><br><br>
                            <table width="58%" border="0" cellpadding="0" cellspacing="0">
                              <tr> 
                                <td colspan="2">Please enter the following information 
                                  or register:</td>
                              </tr>
                              <tr> 
                                <td colspan="2"><img src="imagenes/spacer.gif" width="1" height="10"></td>
                              </tr>
                              <tr> 
                                <td width="32%">First Name:</td>
                                <td width="68%"><input type=text name="nombre" class="t_n" size=25></td>
                              </tr>
                              <tr> 
                                <td><img src="archivos_index/spacer.gif" width="1" height="5"></td>
                              </tr>
                              <tr> 
                                <td>Last Name:</td>
                                <td><input type="text" name="apellido" class="t_n" size="25"></td>
                              </tr>
                              <tr> 
                                <td colspan="2"><img src="imagenes/spacer.gif" width="1" height="5"></td>
                              </tr>
                              <tr> 
                                <td>Phone Number:</td>
                                <td><input type="text" class="t_n" size="5" maxlength="3" name="textfield">
                                <input type="text" name="phone" class="t_n" maxlength="7" size="16"></td>
                              </tr>
                              <tr> 
                                <td colspan="2"><img src="imagenes/spacer.gif" width="1" height="5"></td>
                              </tr>
                              <tr> 
                                <td>E-mail:</td>
                                <td><input type="text" class="t_n" size="25" name="mail"></td>
                              </tr>
                              <tr> 
                                <td>&nbsp;</td>
                                <td><img src="archivos_index/spacer.gif" width="1" height="5"></td>
                              </tr>
                              <tr> 
                                <td height="125" valign="top">Comments:</td>
                                <td><textarea name="coment" cols="32" rows="6" wrap="VIRTUAL" class="t_n"></textarea></td>
                              </tr>
                            </table>
                            <img src="imagenes/spacer.gif" width="1" height="5"><br>
            <br>
    <input type="button" name="Submit" value="Submit" class="t_n" onClick="check_form()">&nbsp;<input value="Reset" class="t_n" type="reset">
     <br><br>       <?
}else{
    
//Estoy recibiendo el formulario, compongo el cuerpo
    
$cuerpo "Formulario enviado\n";
    
$cuerpo .= "Nombre: " $HTTP_POST_VARS["nombre"] . "\n";
    
$cuerpo .= "Apellido: " $HTTP_POST_VARS["apellido"] . "\n";
    
$cuerpo .= "Telefono: " $HTTP_POST_VARS["phone"] . "\n";
    
$cuerpo .= "Email: " $HTTP_POST_VARS["mail"] . "\n";
    
$cuerpo .= "Comentarios: " $HTTP_POST_VARS["coment"] . "\n";

    
//mando el correo...
    
mail("[email protected]","Formulario recibido",$cuerpo);
    echo 
"<br><br><br><br>";
    
//doy las gracias por el envío
    
echo "<div align='center'>Your comments have been send succesfully.</div>";
}
    echo 
"<br><br>";
    echo 
"<div align='center'><input type='button' class='t_n' value='Back' onclick='window.history.back()'></div>";
?>
          </div>
</form>
salu2
__________________
..:: NADA SE PIERDE SOLO SE TRANSFORMA ::..
  #4 (permalink)  
Antiguo 12/05/2005, 09:38
 
Fecha de Ingreso: marzo-2005
Mensajes: 90
Antigüedad: 19 años, 1 mes
Puntos: 0
funcionó!!

muchas gracias maralbust
sds
  #5 (permalink)  
Antiguo 12/05/2005, 09:39
 
Fecha de Ingreso: marzo-2005
Mensajes: 90
Antigüedad: 19 años, 1 mes
Puntos: 0
lo estoy ojeando

gracias dwaks
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.
Tema Cerrado

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 17:02.