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

Voy a utilizar el mismo codigo de antes

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <?php
  5. if(date("H:i:s")<="11:00:00")
  6. { //cuando sean menos o igual a las 11
  7.     $style ="background-color: #FFF; margin-top: 15px;";
  8. }
  9. elseif(date("H:i:s") >="12:00:00")
  10. { //cuando sean mas o igual a las 12
  11.     $style ="background-color: #444; margin-top: 15px;";
  12. }
  13. elseif(date("H:i:s")>="15:30:00")
  14. {//cuando sean mas o igual a las 15:30
  15.     $style ="background-color: #EEE; margin-top: 10px;";
  16. }
  17. else
  18. { //si no es ni una de las anteriores
  19.     $style ="background-color: #000; margin-top: 0px;";
  20. }
  21. ?>
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  23. <title>Documento sin t&iacute;tulo</title>
  24. </head>
  25.  
  26. <body>
  27. <div style="<?php echo $style; ?>">div de prueba</div>
  28. </body>
  29. </html>

Espero haber respondido a tu pregunta