Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/05/2011, 12:26
matiasgreisert
 
Fecha de Ingreso: mayo-2011
Mensajes: 23
Antigüedad: 13 años
Puntos: 0
Respuesta: Creacion de div con valores de post

Gracias gildus por la mano, estuve haciendo algunas modificaciones y ahora el programa no me tira error al enviarlo por post pero no me dibuja el div. Creo q el problema esta en el echo de los divs pero probe varias formas y nunca aparece. Agradezco los aportes.

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