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

Размер файла: 764B
  1. <?php
  2. include 'inc/db.php';
  3. include 'inc/1.php';
  4. if (($user['admin']<1) && ($user['moder']<1)){header("Location: /index.php"); exit;}
  5. $irw=intval($_GET['id']);
  6. if (!$_GET['id']){header("Location: /index.php"); exit;}
  7. $a=mysql_query("SELECT * FROM `forum_t` WHERE `razdel` = '0'");
  8. $b=1;
  9. $count=0;
  10. while ($f=mysql_fetch_assoc($a)){
  11. $o=($b%2);
  12. $d=mysql_query("SELECT * FROM `forum_t` WHERE `razdel` = '$f[id]'");
  13. echo "<div class='p$o'>- ".htmlspecialchars($f['name'])."</div>";
  14. while ($yo=mysql_fetch_assoc($d)){
  15. echo "<div class='input'>- <a href='fokr.php?to=$yo[id]&id=$irw'>".htmlspecialchars($yo['name'])."</a></div>";}
  16. $b++;
  17. }
  18. echo "<div class='p0'><a href='newr.php?id=0'>Новый раздел</a></div>";
  19. include_once 'inc/foot.php';
  20. ?>