Ver Mensaje Individual
  #10 (permalink)  
Antiguo 22/05/2011, 15:03
Avatar de gildus
gildus
 
Fecha de Ingreso: agosto-2003
Mensajes: 1.495
Antigüedad: 20 años, 8 meses
Puntos: 105
Respuesta: Creacion de div con valores de post

Mas o menos asi te refieres?:

Código PHP:
Ver original
  1. <form name="form1" method="POST">
  2.         Top
  3.         <input type="text" name="top" value="<? if(isset($_POST['top'])) echo $_POST['top']; ?>" />
  4.         <br />
  5.         Left
  6.         <input type="text" name="left" value="<? if(isset($_POST['left'])) echo $_POST['left']; ?>" />
  7.         <br />
  8.         Width
  9.         <input type="text" name="width" value="<? if(isset($_POST['width'])) echo $_POST['width']; ?>" />
  10.         <br />
  11.         Height
  12.         <input type="text" name="height" value="<? if(isset($_POST['height'])) echo $_POST['height']; ?>" />
  13.         <br />
  14.         <input type="submit"/>
  15.     </form>
  16. <br /><br />
  17. <?php
  18. if(isset($_POST["top"]) && isset($_POST["left"]) && isset($_POST["width"]) && isset($_POST["height"]))
  19. {   $top=trim($_POST["top"]);
  20.     $left= trim($_POST["left"]);
  21.     $width= trim($_POST["width"]);
  22.     $height= trim($_POST["height"]);
  23.     if(!is_numeric($top)) die('Top no es numerico');
  24.     if(!is_numeric($left)) die('Left no es numerico');
  25.     if(!is_numeric($width)) die('Width no es numerico');
  26.     if(!is_numeric($height)) die('Height no es numerico');
  27.    
  28.     echo "<div style = 'top:".$top."px; left:".$left."px; height:".$height."px; width:".$width."px; background-color:blue;'>";
  29.     echo "</div>";
  30.    
  31.    
  32. }      
  33. ?>


Saludos
Gildus
__________________
.: Gildus :.