Código PHP:
Ver original
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="engine1/style.css" /> <script type="text/javascript" src="engine1/jquery.js"></script> <link rel='stylesheet' href='estilos.css'> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script> <script src='funciones.js'></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Taller de psicomotricidad en caba zona oeste y zona sur - Juego y Desarrollo-</title> <META NAME="google-site-verification" CONTENT="+nxGUDJ4QpAZ5l9Bsjdi102tLVC21AIh5d1Nl23908vVuFHs34="/> <META NAME="robots" CONTENT="index,follow"> <META NAME="revisit-after" CONTENT="3 days"/> <style type="text/css"> .fondoinicio { background-image: url(imagenes/fondocontacto.jpg); background-repeat: no-repeat; font-family: Georgia, "Times New Roman", Times, serif; font-size: 16px; font-style: italic; text-align: justify; } a:link { color: #000; text-decoration: none; } a:visited { text-decoration: none; color: #000; } a:hover { text-decoration: none; color: #000; } a:active { text-decoration: none; color: #000; } #solo { text-align: center; } #negra { font-weight: bold; } justificar { text-align: justify; } .fondoinicio table tr td p { text-align: justify; } body { background-image: url(fondo.jpg); background-repeat: repeat; } </style></head> <body> <?php if($_POST['nombre'] == ''){ $error1 = '<span class="error">Ingrese su nombre</span>'; }else if($_POST['email'] == '' or !preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/",$_POST['email'])){ $error2 = '<span class="error">Ingrese un email correcto</span>'; }else if($_POST['telefono'] == ''){ $error3 = '<span class="error">Ingrese un telefono</span>'; }else if($_POST['mensaje'] == ''){ $error4 = '<span class="error">Ingrese un mensaje</span>'; }else{ $nombre = $_POST['nombre']; $email = $_POST['email']; $telefono = $_POST['telefono']; //Telefono $cuerpo = $_POST['mensaje']; //Cuerpo del mensaje //Cabeceras del correo $headers = "From: $nombre $email\r\n"; //Quien envia? $headers .= "X-Mailer: PHP5\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // $sql = "INSERT INTO `cf` (`nombre`,`email`,`telefono`,`mensaje`) VALUES ('{$_POST['nombre']}','{$_POST['email']}','{$_POST['telefono']}','{$_POST['mensaje']}')"; $result = '<div class="result_ok">Email enviado correctamente!</div>'; // si el envio fue exitoso reseteamos lo que el usuario escribio: $_POST['nombre'] = ''; $_POST['email'] = ''; $_POST['telefono'] = ''; $_POST['mensaje'] = ''; }else{ $result = '<div class="result_fail">Hubo un error al enviar el mensaje!</div>'; } } } ?> <table width="994" border="0" align="center"> <tr> <td width="988" height="1134" valign="top" class="fondoinicio"><p><br /> <br /> <br /> <br /> <br /> <br /> </p> <p> </p> <table width="740" border="0" align="center"> <tr> <td height="59" id="menu"><table width="740" border="0" align="center"> <tr> <td width="93" height="35" align="center"><a href="index.html" target="_self">Inicio</a></td> <td width="136" align="center"><a href="tallerdejuego.html" target="_self">Taller de juego</a></td> <td width="106" align="center"><a href="educacion.html" target="_self">Educación</a></td> <td width="73" align="center"><a href="terapia.html" target="_self">Terapia</a></td> <td width="188" align="center"><a href="trabajoconpadres.html" target="_self">Trabajo con padres</a></td> <td width="102" align="center"><a href="contacto.php" target="_self">Contacto</a></td> <td width="12" align="center"> </td> </tr> </table></td> </tr> </table> <br /> <table width="715" border="0" align="center"> <tr> <td class="ws_images"><div id="wowslider-container1"> <div class="ws_images"><ul> <li><img src="data1/images/10b.jpg" alt="" title="" id="wows1_0"/></li> <li><img src="data1/images/13b.jpg" alt="" title="" id="wows1_1"/></li> <li><img src="data1/images/14b.jpg" alt="" title="" id="wows1_2"/></li> <li><img src="data1/images/3b.jpg" alt="" title="" id="wows1_3"/></li> </ul></div> <div class="ws_bullets"><div> <a href="#" title="">1</a> <a href="#" title="">2</a> <a href="#" title="">3</a> <a href="#" title="">4</a> </div></div> <a class="wsl" href="http://wowslider.com">jQuery Slider Demo by WOWSlider.com v2.4</a> <div class="ws_shadow"></div> </div> <script type="text/javascript" src="engine1/wowslider.js"></script> <script type="text/javascript" src="engine1/script.js"></script> </td> </tr> </table> <br /> <br /> <br /> <table width="589" border="0"> <tr> <td width="35"> </td> <td width="544" colspan="2"><img src="imagenes/separadorarriba.png" width="547" height="74" /></td> </tr> <tr> <td height="131" valign="top"> </td> <td><form class='contacto' method='POST' action='contacto.php'> <div><label>Tu Nombre:</label><input type='text' class='nombre' name='nombre' value='<?php echo $_POST['nombre']; ?>'><?php echo $error1 ?></div> <div><label>Tu Email:</label><input type='text' class='email' name='email' value='<?php echo $_POST['email']; ?>'><?php echo $error2 ?></div> <div><label>Telefono:</label><input type='text' class='telefono' name='telefono' value='<?php echo $_POST['telefono']; ?>'><?php echo $error3 ?></div> <div><label>Mensaje:</label><textarea rows='6' class='mensaje' name='mensaje'><?php echo $_POST['mensaje']; ?></textarea><?php echo $error4 ?></div> <div><input type='submit' value='Envia Mensaje' class='boton' name='boton'></div> <?php echo $result; ?> </form></p></td> <td valign="top"><br /> <br /> <br /> <br /> <p> /> <br /> <br /> </p> <p><br /> <br /> <br /> </p></td> </tr> <tr> <td height="44"> </td> <td colspan="2" valign="top"><img src="imagenes/separadorphp.png" width="547" height="42" /></td> </tr> </table> <br /></td> </tr> </table> <table width="995" border="0" align="center"> <tr> <td height="21" align="center">Pagina realizada por <a href="http://nldweb.com.ar/" target="_blank">nldweb.com.ar</a></td> </tr> </table> </body> </html>