Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/05/2011, 15:21
matiasgreisert
 
Fecha de Ingreso: mayo-2011
Mensajes: 23
Antigüedad: 13 años
Puntos: 0
Guardar datos en array para crear div

Hola, necesitaria guardar datos en un array para utilizarlos en la creacion de div. Si cargo 10 datos, crear 10 divs. Espero sus respuestas. Dejo el codigo que genera solo un div y al cargar nuevos datos borra el anterio. Gracias saludos

<form name="form1" method="POST">
Top
<input type="text" name="top" value="<?php if(isset($_POST['top'])) echo $_POST['top']; ?>" />
<br />
Left
<input type="text" name="left" value="<?php if(isset($_POST['left'])) echo $_POST['left']; ?>" />
<br />
Width
<input type="text" name="width" value="<?php if(isset($_POST['width'])) echo $_POST['width']; ?>" />
<br />
Height
<input type="text" name="height" value="<?php if(isset($_POST['height'])) echo $_POST['height']; ?>" />
<br />
<input type="submit"/>
</form>
<br /><br />
<?php
if(isset($_POST["top"]) && isset($_POST["left"]) && isset($_POST["width"]) && isset($_POST["height"]))
{
$top=($_POST["top"]);
$left=($_POST["left"]);
$width=($_POST["width"]);
$height=($_POST["height"]);
if(!is_numeric($top)) die ('Top no es numerico <br />');
if(!is_numeric($left)) die ('Left no es numerico <br />');
if(!is_numeric($width)) die ('Width no es numerico <br />');
if(!is_numeric($height)) die ('Height no es numerico <br />');
echo "<div style = 'top:".$top."px; left:".$left."px; height:".$height."px; width:".$width."px; background-color:blue; position:relative;'>";
echo "</div>";
}

?>