File size: 2.2Kb
<?
include $DOCUMENT_ROOT.'/inc/header.php';
include $DOCUMENT_ROOT.'/inc/db/config.php';
print '
<table align="center" border="1" columns="4">
<tr align="center">
<th>ID</th>
<th>'.rus('Адрес').'</th>
<th>'.rus('Страница').'</th>
<th>'.rus('Дата').'</th>
</tr>
<tr align="center">
';
######################### config.php
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "test";
$dbc = mysql_connect($db_host, $db_user, $db_pass); // Eiiiae? e aa
$dbs = mysql_select_db($db_name); // Auaid aa
$max_mess = 3;
########################
######################################################### Auyniea? ii?ad n?diee
if (empty($page)) $page = 0;
if ($page < 0) $page = 0;
#########################################################
######################################################### N?e?aa? iauaa eie-ai oin?ia
$count_query = 'select count(*) from ip where 1 ;';
$total_mess = mysql_query ($count_query);
$total_count = mysql_fetch_array ($total_mess);
$count = $total_count ['count(*)'];
##########################################################
// Een?eia auaiaa oin?ia
$query = "SELECT * FROM ip LIMIT ".$page.", ".$max_mess." ;";
if (!$query) echo mysql_error();
$result = mysql_query($query);
if (!$result) echo mysql_error();
while($otvet = mysql_fetch_array($result))
{
print_r('<td align="center"><small>'.$id = $otvet ['id_ip'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['ip'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['page'].'</small></td>');
print_r('<td align="center"><small>'.$id = $otvet ['date'].'</small></td>');
echo '</tr>';
echo '<tr>';
}
print '
</tr>
</table>
';
####################################################### Nicaaiea nnueie
if ($page > 0) echo '<a href="'.$PHP_SELF.'?page='.($page - $max_mess).'">Предыдущие</a> ';
if ($count > $page + $max_mess) echo '<a href="'.$PHP_SELF.'?page='.($page + $max_mess).'">Следующие</a>';
#######################################################
include $DOCUMENT_ROOT.'/inc/footer_stat.php';
?>