Просмотр файла index.php

Размер файла: 2.67Kb
  1. <?php
  2. header("Content-type: text/vnd.wap.xhtml+xml; charset=utf-8");
  3. header("Cache-control: no-cache;");
  4. header("Pragma: no-cache;");
  5. ?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8"/>
  10. <meta http-equiv="Content-Style-Type" content="text/css"/>
  11. <title>Статьи
  12. </title>
  13. </head>
  14. <body>
  15. <p align="left" style="background-color:green">
  16. <span style="color:white"><small>Статьи на различную тематику:</small>
  17. </span>
  18. </p>
  19. <p align="left" style="background-color:white">
  20. <?php
  21. list($msec, $sec) = explode(chr(32), microtime());
  22. $time = $sec + $msec;
  23. require('config.ini');
  24. require('Navigator.class.php');
  25. $q=mysql_query("SELECT count(*) FROM articles");
  26. $all=mysql_result($q,0,0);
  27. if(empty($all)) {
  28. echo '<span style="color:green"><small>Статей пока нет...</small>
  29. </span>'; }
  30. if ($all)
  31. {
  32. $pnumber=$coll;
  33. $n=new Navigator($all,$pnumber);
  34.  
  35.  
  36.  
  37. $q=mysql_query("SELECT * FROM articles ORDER by id DESC LIMIT {$n->start()},$pnumber");
  38. while (false!==($res=mysql_fetch_assoc($q)))
  39. {
  40. echo '<a href="./art.php?id='.$res['id'].'"><span style="color:green"><small>'.htmlspecialchars($res['name']).'</small>
  41. </span></a><br />';
  42. }
  43. echo '<span style="color:green"><small>'.$n->navi().'</small>
  44. </span>';
  45. }
  46. list($msec, $sec) = explode(chr(32), microtime());
  47. echo '<br /><span style="color:green"><small>Генерация скрипта '.round(($sec + $msec) - $time, 4).' секунд</small>
  48. </span>';
  49.  
  50. echo '</p>
  51. <p align="center" style="background-color:green">
  52. <span style="color:white"><small>All rights reserved 2008</small>
  53. </span>
  54. </p>
  55. </body>
  56. </html>';