02/12/2010, 11:33
|
| Usuario no validado | | Fecha de Ingreso: marzo-2002 Ubicación: Buenos Aires
Mensajes: 1.300
Antigüedad: 22 años, 2 meses Puntos: 8 | |
Respuesta: formulario con ajax aqui sigue...
process.php Código PHP: <?php //para codificar las variables // $firstName = iconv("UTF-8", "ISO-8859-1", $_POST['firstName']); if ((isset($_POST['nombre'])) && (strlen(trim($_POST['nombre'])) > 0)) { $nombre1 = stripslashes(strip_tags($_POST['nombre'])); $nombre = iconv("UTF-8", "ISO-8859-1", $nombre1); } else {$name = '';} if ((isset($_POST['apellidos'])) && (strlen(trim($_POST['apellidos'])) > 0)) { $apellidos1 = stripslashes(strip_tags($_POST['apellidos'])); $apellidos = iconv("UTF-8", "ISO-8859-1", $apellidos1); } else {$apellidos = '';} if ((isset($_POST['telefono'])) && (strlen(trim($_POST['telefono'])) > 0)) { $telefono = stripslashes(strip_tags($_POST['telefono'])); } else {$telefono = '';} if ((isset($_POST['email'])) && (strlen(trim($_POST['email'])) > 0)) { $email = stripslashes(strip_tags($_POST['email'])); } else {$email = '';} if ((isset($_POST['poblacion'])) && (strlen(trim($_POST['poblacion'])) > 0)) { $poblacion1 = stripslashes(strip_tags($_POST['poblacion'])); $poblacion = iconv("UTF-8", "ISO-8859-1", $poblacion1); } else {$poblacion = '';} if ((isset($_POST['provincia'])) && (strlen(trim($_POST['provincia'])) > 0)) { $provincia1 = stripslashes(strip_tags($_POST['provincia'])); $provincia = iconv("UTF-8", "ISO-8859-1", $provincia1); } else {$provincia = '';} if ((isset($_POST['empresa'])) && (strlen(trim($_POST['empresa'])) > 0)) { $empresa1 = stripslashes(strip_tags($_POST['empresa'])); $empresa = iconv("UTF-8", "ISO-8859-1", $empresa1); } else {$empresa = '';} if ((isset($_POST['cargo'])) && (strlen(trim($_POST['cargo'])) > 0)) { $cargo1 = stripslashes(strip_tags($_POST['cargo'])); $cargo = iconv("UTF-8", "ISO-8859-1", $cargo1); } else {$cargo = '';} if ((isset($_POST['peticion'])) && (strlen(trim($_POST['peticion'])) > 0)) { $peticion1 = iconv("UTF-8", "ISO-8859-1", $_POST['peticion']); $peticion_a= str_replace(Chr(13), "\n", $peticion1); //$peticion2 = stripslashes($peticion1); //$peticion2 = stripslashes(strip_tags($peticion1, "<br>")); //AddSlashes($_POST["f_serv_otros_text"]); estoperita que esrivan /' // } else {$peticion = '';} ob_start(); ?> <html> <head> <style type="text/css"> </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <table width="550" border="1" cellspacing="2" cellpadding="2"> <tr bgcolor="#eeffee"> <td width="115">Nombre</td> <td width="415"><?=$nombre;?></td> </tr> <tr bgcolor="#eeeeff"> <td>Apellidos</td> <td><?=$apellidos;?></td> </tr> <tr bgcolor="#eeffee"> <td>Telefono</td> <td><?=$telefono;?></td> </tr> <tr bgcolor="#eeeeff"> <td>Email</td> <td><?=$email;?></td> </tr> <tr bgcolor="#eeffee"> <td>Población</td> <td><?=$poblacion;?></td> </tr> <tr bgcolor="#eeeeff"> <td>Provincia</td> <td><?=$provincia;?></td> </tr> <tr bgcolor="#eeffee"> <td>Empresa</td> <td><?=$empresa;?></td> </tr> <tr bgcolor="#eeeeff"> <td>Cargo</td> <td><?=$cargo;?></td> </tr> <tr bgcolor="#eeffee"> <td>Petición</td> <td><?=$peticion_a;?></td> </tr> </table> </body> </html> <? $body = ob_get_contents(); //$to = '[email protected]'; //$email = '[email protected]'; //$fromaddress = "[email protected]"; //$fromname = "Contacto del comercio.biz"; require("phpmailer.php"); $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Contacto del comercio.biz"; $mail->AddAddress("[email protected]"); //$mail->AddAddress("[email protected]","joan esigual"); $mail->AddBCC("[email protected]"); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = "Contacto del comercio.biz"; $mail->Body = $body; $mail->AltBody = "Este texto solo esta en el body"; if(!$mail->Send()) { $recipient = '[email protected]'; $subject = 'Contact form failed'; $content = $body; mail($recipient, $subject, $content, "From: [email protected]\r\nReply-To: $email\r\nX-Mailer: DT_formmail"); exit; } ?> |