Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/12/2012, 11:34
3lineas
 
Fecha de Ingreso: julio-2011
Mensajes: 113
Antigüedad: 12 años, 9 meses
Puntos: 4
Respuesta: formulario de contacto acorta fondo de pagina al enviar el mensaje

Cita:
Iniciado por 3lineas Ver Mensaje
Hola, como andan? tengo un problema, en esta pagina tengo un formulario que anda perfecto, el problema es que cuando envia el mensaje y aparece el cartel de "enviado correctamente" se acorta el fondo de la web un poco, y queda mal, saben como lo puedo solucionar? gracias.
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="engine1/style.css" />
  5.     <script type="text/javascript" src="engine1/jquery.js"></script>
  6.    <link rel='stylesheet' href='estilos.css'>
  7.         <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script>
  8. <script src='funciones.js'></script>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <META NAME="google-site-verification" CONTENT="+nxGUDJ4QpAZ5l9Bsjdi102tLVC21AIh5d1Nl23908vVuFHs34="/>
  11. <META NAME="robots" CONTENT="index,follow">
  12. <META NAME="revisit-after" CONTENT="3 days"/>
  13. <style type="text/css">
  14. .fondoinicio {
  15.     background-image: url(imagenes/fondocontacto.jpg);
  16.     background-repeat: no-repeat;
  17.     font-family: Georgia, "Times New Roman", Times, serif;
  18.     font-size: 16px;
  19.     font-style: italic;
  20.     text-align: justify;
  21. }
  22. a:link {
  23.     color: #000;
  24.     text-decoration: none;
  25. }
  26. a:visited {
  27.     text-decoration: none;
  28.     color: #000;
  29. }
  30. a:hover {
  31.     text-decoration: none;
  32.     color: #000;
  33. }
  34. a:active {
  35.     text-decoration: none;
  36.     color: #000;
  37. }
  38. #solo {
  39.     text-align: center;
  40. }
  41. #negra {
  42.     font-weight: bold;
  43. }
  44. justificar {
  45.     text-align: justify;
  46. }
  47. .fondoinicio table tr td p {
  48.     text-align: justify;
  49. }
  50. body {
  51.     background-image: url(fondo.jpg);
  52.     background-repeat: repeat;
  53. }
  54. </style></head>
  55. <body>
  56. <?php
  57.         if(isset($_POST['boton'])){
  58.             if($_POST['nombre'] == ''){
  59.                 $error1 = '<span class="error">Ingrese su nombre</span>';
  60.             }else if($_POST['email'] == '' or !preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/",$_POST['email'])){
  61.                 $error2 = '<span class="error">Ingrese un email correcto</span>';
  62.             }else if($_POST['telefono'] == ''){
  63.                 $error3 = '<span class="error">Ingrese un telefono</span>';
  64.             }else if($_POST['mensaje'] == ''){
  65.                 $error4 = '<span class="error">Ingrese un mensaje</span>';
  66.             }else{         
  67.                 $dest = "[email protected]"; //Email de destino
  68.                 $nombre = $_POST['nombre'];
  69.                 $email = $_POST['email'];
  70.                 $telefono = $_POST['telefono']; //Telefono
  71.                 $cuerpo = $_POST['mensaje']; //Cuerpo del mensaje
  72.                 //Cabeceras del correo
  73.                 $headers = "From: $nombre $email\r\n"; //Quien envia?
  74.                 $headers .= "X-Mailer: PHP5\n";
  75.                 $headers .= 'MIME-Version: 1.0' . "\n";
  76.                 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //
  77.                
  78.                 if(mail($dest,$telefono,$cuerpo,$headers)){
  79.                    
  80.                     $sql = "INSERT INTO `cf` (`nombre`,`email`,`telefono`,`mensaje`) VALUES ('{$_POST['nombre']}','{$_POST['email']}','{$_POST['telefono']}','{$_POST['mensaje']}')";
  81.                     $result = '<div class="result_ok">Email enviado correctamente!</div>'; 
  82.                     // si el envio fue exitoso reseteamos lo que el usuario escribio:
  83.                     $_POST['nombre'] = '';
  84.                     $_POST['email'] = '';
  85.                     $_POST['telefono'] = '';
  86.                     $_POST['mensaje'] = '';
  87.  
  88.                 }else{
  89.                     $result = '<div class="result_fail">Hubo un error al enviar el mensaje!</div>';
  90.                 }
  91.             }
  92.         }
  93.     ?>
  94. <table width="994" border="0" align="center">
  95.   <tr>
  96.     <td width="988" height="1134" valign="top" class="fondoinicio"><p><br />
  97.       <br />
  98.       <br />
  99.       <br />
  100.       <br />
  101.       <br />
  102.     </p>
  103.       <p>&nbsp;</p>
  104.       <table width="740" border="0" align="center">
  105.         <tr>
  106.           <td height="59" id="menu"><table width="740" border="0" align="center">
  107.             <tr>
  108.               <td width="93" height="35" align="center"><a href="index.html" target="_self">Inicio</a></td>
  109.               <td width="136" align="center"><a href="tallerdejuego.html" target="_self">Taller de juego</a></td>
  110.               <td width="106" align="center"><a href="educacion.html" target="_self">Educación</a></td>
  111.               <td width="73" align="center"><a href="terapia.html" target="_self">Terapia</a></td>
  112.               <td width="188" align="center"><a href="trabajoconpadres.html" target="_self">Trabajo con padres</a></td>
  113.               <td width="102" align="center"><a href="contacto.php" target="_self">Contacto</a></td>
  114.               <td width="12" align="center">&nbsp;</td>
  115.             </tr>
  116.           </table></td>
  117.         </tr>
  118.       </table>
  119.       <br />
  120.       <table width="715" border="0" align="center">
  121.         <tr>
  122.         <td class="ws_images"><div id="wowslider-container1">
  123.     <div class="ws_images"><ul>
  124. <li><img src="data1/images/10b.jpg" alt="" title="" id="wows1_0"/></li>
  125. <li><img src="data1/images/13b.jpg" alt="" title="" id="wows1_1"/></li>
  126. <li><img src="data1/images/14b.jpg" alt="" title="" id="wows1_2"/></li>
  127. <li><img src="data1/images/3b.jpg" alt="" title="" id="wows1_3"/></li>
  128. </ul></div>
  129. <div class="ws_bullets"><div>
  130. <a href="#" title="">1</a>
  131. <a href="#" title="">2</a>
  132. <a href="#" title="">3</a>
  133. <a href="#" title="">4</a>
  134. </div></div>
  135. <a class="wsl" href="http://wowslider.com">jQuery Slider Demo by WOWSlider.com v2.4</a>
  136.     <div class="ws_shadow"></div>
  137.     </div>
  138.     <script type="text/javascript" src="engine1/wowslider.js"></script>
  139.     <script type="text/javascript" src="engine1/script.js"></script>&nbsp;</td>
  140.       </tr>
  141.   </table>
  142.       <br />
  143.       <br />
  144.       <br />
  145.       <table width="589" border="0">
  146.         <tr>
  147.       <td width="35">&nbsp;</td>
  148.       <td width="544" colspan="2"><img src="imagenes/separadorarriba.png" width="547" height="74" /></td>
  149.     </tr>
  150.     <tr>
  151.       <td height="131" valign="top">&nbsp;</td>
  152.       <td><form class='contacto' method='POST' action='contacto.php'>
  153.             <div><label>Tu Nombre:</label><input type='text' class='nombre' name='nombre' value='<?php echo $_POST['nombre']; ?>'><?php echo $error1 ?></div>
  154.             <div><label>Tu Email:</label><input type='text' class='email' name='email' value='<?php echo $_POST['email']; ?>'><?php echo $error2 ?></div>
  155.             <div><label>Telefono:</label><input type='text' class='telefono' name='telefono' value='<?php echo $_POST['telefono']; ?>'><?php echo $error3 ?></div>
  156.             <div><label>Mensaje:</label><textarea rows='6' class='mensaje' name='mensaje'><?php echo $_POST['mensaje']; ?></textarea><?php echo $error4 ?></div>
  157.             <div><input type='submit' value='Envia Mensaje' class='boton' name='boton'></div>
  158.             <?php echo $result; ?>
  159.         </form></p></td>
  160.       <td valign="top"><br />
  161.         <br />
  162.         <br />
  163.         <br />
  164.         <p> />
  165.         <br />
  166.         <br />
  167.         </p>
  168.         <p><br />
  169.          <br />
  170.           <br />
  171.           </p></td>
  172.     </tr>
  173.     <tr>
  174.       <td height="44">&nbsp;</td>
  175.       <td colspan="2" valign="top"><img src="imagenes/separadorphp.png" width="547" height="42" /></td>
  176.     </tr>
  177. </table>
  178.   <br /></td>
  179.   </tr>
  180. </table>
  181. <table width="995" border="0" align="center">
  182.   <tr>
  183.     <td height="21" align="center">Pagina realizada por <a href="http://nldweb.com.ar/" target="_blank">nldweb.com.ar</a></td>
  184.   </tr>
  185. </table>
  186. </body>
  187. </html>