Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/05/2011, 13:41
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

Holas,

Aqui el codigo:

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


En tu estilo no existe backgroud-color sino background-color

Saludos
Gildus
__________________
.: Gildus :.