View file users.php

File size: 1.47Kb
<?php
##################################
#           users.php            #
##################################
#   Форум на MySQL               #
#Афтар : Morgan                  #
#ICQ : 530-648                   #
#Email : [email protected]           #
##################################
 require_once 'includes/start.php';
 require_once 'includes/functions.php';
 require_once 'includes/db.php';
 require_once 'includes/avt.php';
 require_once 'includes/head.php';

if(isset($_GET['page']))
{$page = $_GET['page'];}
else{$page=1;}
$p_str = $page*$on_page-$on_page;

echo '</div><div class="main">
Юзеры
</div><div class="fon">
Сортировать по: <a href="users.php?sort=nick">нику</a>,<a href="users.php?sort=post">постам</a><br />
<br />
';
if($_GET['sort']=='nick' or $_GET['sort']=='post')
{
switch($_GET['sort']) {
case 'nick': $sort = 'login'; break;
case  'post': $sort = 'posts'; break;
}
$userof = mysql_num_rows(mysql_query('SELECT login,posts FROM `users`'));
$user = mysql_query('SELECT login,posts FROM `users` ORDER BY '.$sort.' ASC LIMIT '.$p_str.','.$on_page.'');
while($f= mysql_fetch_array($user))
{



echo 'Юзер :<b>'.$f['login'].'</b><br />
Постов</b> :<b>'.$f['posts'].'</b><br />
<br />';

}
}



echo '</div><br />
';


 require_once 'includes/foot.php';
##################################
#      © Все права защищены      #
##################################
?>