30/08/2005, 11:12
|
| | | Fecha de Ingreso: mayo-2005 Ubicación: ureleando
Mensajes: 505
Antigüedad: 18 años, 10 meses Puntos: 3 | |
Yo uso un codigo asi: Código PHP: <?php // TRAIGO LOS VALORES DE LOS CAMPOS DE MI FORMULARIO $link=Conectarse(); $codigo=$_GET['Id']; $nombre=$_GET['nombre']; $apellido=$_GET['apellido']; $email=$_GET['email']; $evaluacion=$_GET['evaluacion']; $mensaje=$_GET['mensaje']; $fecha= time(); $hr = date("H",$fecha) - 5; $hora= $hr.":".date("i:s",$fecha); $dia= date("d/m/Y",$fecha); //LOS GUARDO EN LA BD mysql_query("insert into lenceria (nombre,apellido,email,evaluacion,fecha,hora,mensaje) values ('$nombre','$apellido','$email','$evaluacion','$dia','$hora','$mensaje')",$link); //GENERO EL CODIGO HTML QUE VA A SER ENVIADO POR CORREO $codigohtml = ' <html> <head> <title>E-Mail HTML</title> </head> <body> <table width="570" border="0"> <tr> <td>Este mensaje viene del Buzón de Sugerencias de Lenceria</td> </tr> <tr> <td bgcolor="#CCCCCC">Lo mando: ' . $nombre . ' ' . $apellido . '. E-mail: ' . $email .'</td> </tr> <tr> <td bgcolor="#CCCCCC">el dia ' . $dia . '</td> </tr> <tr> <td bgcolor="#CCCCCC">y dice lo siguiente: ' . $mensaje . '</td> </tr> </table></body>'; //CAMPOS PARA EL MAIL $elmail = '[email protected]'; $asunto = 'Buzon Lenceria'; $cabeceras = "Content-type: text/html\r\n"; //ENVIO EL MAIL mail($elmail,$asunto,$codigohtml,$cabeceras); //ACA ME FIJO SI EL MAIL SALIO CORRECTAMENTE //Y MUESTRO EN LA MISMA VENTANA LA CONFIRMACION if(mail){ echo ' <html><head> <script language="JavaScript"> function cerrar() { var ventana = window.self; ventana.opener = window.self; parent.close(); } </script> </head> <body> <table width="356" border="0"> <tr> <td width="350" height="5"><div align="center"><img src="enc_lenceria.gif" width="350" height="95"></div></td> </tr> <tr> <td height="5"> <br></td> </tr> <tr> <td height="5" ><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:12px" color="#000000"><b>Gracias</b></font> </div></td> </tr> <tr> <td height="6" ><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:12px" color="#000000"><div align="center"><b>'.$nombre.' '.$apellido.'</b></div></font></td> </tr> <tr> <td height="13" ><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size:12px" align="center" color="#000000"><b>Por opinar.</b> </font></div></td> </tr> <tr> <td height="2" bgcolor="#Cccccc"><img src="pie.gif" width="350" height="6"></td> </tr> <tr> <td height="6" ><div align="center"> </div></td> </tr> <tr> <td height="6" "><div align="center"> </div></td> </tr> <tr> <tr> <td height="6" "><div align="center"> </div></td> </tr> <tr> <tr> <td height="6" "><div align="center"> </div></td> </tr> <tr> <tr> <td height="6" "><div align="center"> </div></td> </tr> <tr> <td height="2" ><div align="center"><input type="submit" name="Submit" value="Cerrar Ventana" onClick="cerrar();"></div></td> </tr> </table> </body> '; }else{ echo "Error. Presione el Botón 'ATRAS' de su navegador e intentelo nuevamente. GRACIAS"; } ?> Esta es la ventana a la que paso al presionar "Enviar" desde mi formulario.
o sea la que va en el ACTION del Formulario. |