Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/01/2010, 16:23
SoutlinK
 
Fecha de Ingreso: junio-2007
Mensajes: 189
Antigüedad: 16 años, 10 meses
Puntos: 3
Respuesta: Cambiar fondo de web

Se le olvido poner un ; en el fondo2

Ademas puso etiquetas <?, ami las veces que lo probe me dio problemas asique yo las pondria <?php y en el ultimo echo $imagen le falta tambien un ;

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
if(date("H:i:s")<="11:00:00")
//cuando sean menos o igual a las 11
    
$imagen="madrugada.jpg";
}
elseif(
date("H:i:s") >="12:00:00")
//cuando sean mas o igual a las 12
    
$imagen="images/fondo2.jpg";
}
elseif(
date("H:i:s")>="15:30:00")
{
//cuando sean mas o igual a las 15:30
    
$imagen="images/fondo3.jpg";
}
else
//si no es ni una de las anteriores
    
$imagen="default.jpg";
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body background="<?php echo $imagen?>">
</body>
</html>