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

Размер файла: 1Kb
  1. <?php
  2. include 'inc/db.php';
  3. include 'inc/1.php';
  4. $id=intval($_GET['id']);
  5. if (!$_GET['id']){header("Location: /index.php");
  6. exit;}
  7. $ank=gus($id);
  8. if ($ank['name']==''){header("Location: /index.php");
  9. exit;}
  10. echo "<div class='t2'>Файлы пользователя</div>";
  11. if (!$_GET['p'])$_GET['p']=1;
  12. $p=intval($_GET['p']);
  13. $start=(($p*15)-15);
  14. $q=mysql_query("SELECT `id`, `name`, `ras`, `time` FROM `obmen` WHERE `user` = '$id' ORDER BY `time` DESC LIMIT $start, 15");
  15. $b=1;
  16. while ($f=mysql_fetch_assoc($q)){
  17. $post=($b%2);
  18. echo "<div class='p$post'>";
  19. $name=out($f['name']);
  20. $ras=htmlspecialchars($f['ras']);
  21. $time=vremja($f['time']);
  22. echo "<a href='file.php?id=$f[id]'>$name.$ras</a> ($ank[name])<br>[$time]";
  23. echo "</div>";
  24. $b++;
  25. }
  26. $q1=(mysql_num_rows(mysql_query("SELECT `id` FROM `obmen` WHERE `user` = '$id'"))/15);
  27. $q2=round(mysql_num_rows(mysql_query("SELECT `id` FROM `obmen` WHERE `user` = '$id'"))/15);
  28. if ($q1>$q2)$pages=($q2+1);
  29. pages($pages, $p, "?p");
  30. include 'inc/foot.php';
  31. ?>