Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/05/2016, 18:49
Avatar de kip13
kip13
 
Fecha de Ingreso: agosto-2011
Mensajes: 167
Antigüedad: 12 años, 8 meses
Puntos: 13
Respuesta: Duda sencilla, contenido de un formulario en un div en otra página

¿Entonces deseas que este contenido y por supuesto el nuevo div se queden hasta que la pagina sea actualizada?

Tengo un ejemplo sencillo a ver si es lo que andas buscando:

ingresocontenido.html

Código HTML:
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. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Envio DIV</title>
  5. </head>
  6. <form action="datos2.php" id="form1" name="form1" method="post">
  7. Contenido del div a ingresar:
  8. <textarea name="contenido"></textarea>
  9. <input type="submit" value="Enviar DIV" input>
  10. </form>
  11. </body>
  12. </html>

datos2.php
Código PHP:
Ver original
  1. <?php
  2. if (isset($_POST["contenido"]) && !empty($_POST["contenido"])) {
  3.         $contenido = '';
  4.     $contenido.= '<div id="content">';
  5.     $contenido.= $_POST["contenido"];
  6.     $contenido.= '</div>';  
  7. }else{  
  8.     $contenido = '';
  9. }
  10. ?>
  11.  
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  13. <html xmlns="http://www.w3.org/1999/xhtml">
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16. <title>Documento sin título</title>
  17. <style type="text/css" >
  18. #content{
  19.     padding:12px;
  20.     margin-top:10px;
  21.     border:#333 2px solid;
  22.     font-size:16px;
  23.     background-color:#000;
  24.     color:#FFF;
  25.     height:auto;
  26.     font-style:italic;
  27.     width:auto;
  28.     border-radius:4px;
  29. }
  30. #contenidoant{
  31.     padding:12px;
  32.     border:#333 2px solid;
  33.     font-size:16px;
  34.     background-color:#fafafa;
  35.     color:#000;
  36.     height:auto;
  37.     width:auto;
  38.     border-radius:4px;
  39. }
  40. #message{
  41.     padding:12px;
  42.     border:#000 2px solid;
  43.     background-color:#FFF;
  44.     height:auto;
  45.     width:200px;
  46.     margin-left:auto;
  47.     margin-right:auto;
  48.     text-align:center;
  49.     }
  50. </style>
  51. </head>
  52.  
  53. <body>
  54. <div id="message">
  55. <div id="contenidoant">Esto es un mensaje, esto es un mensaje, esto es un mensaje, esto es un mensaje, acabo el mensaje.</div>
  56. <?php echo $contenido ?>
  57. </div>
  58. </body>
  59. </html>

Avisanos si te sirve.

Saludos

Última edición por kip13; 03/05/2016 a las 19:23