Размер файла: 3.32Kb
<?php
session_start();
if(!empty($_POST)) header("Location:$PHP_SELF");
$b_psswd = "Ваш пароль";
$b_data = "bots.dat";
$b_msgp = 50;
$data = file($b_data);
$maxmsg = count($data);
rsort ($data);
if($logon) {
if ($password == $b_psswd) {
session_register("psswd");
$psswd = $password;
}
}
if ($delete) {
$fp = fopen($b_data,"w");
ftruncate ($fp,0);
fclose($fp);
}
?>
<html>
<head>
<title>Статистика визитов поисковых ботов</title>
<style type="text/css">
body, td {margin-top:0px; margin-bottom:0px; font-weight:normal; font-size:11px; color:#000000; font-family:tahoma; text-decoration:none}
input {font-weight:normal; font-size:11px; color:black; font-family:tahoma; text-decoration:none; border-right:#808080 1px solid; border-top:#808080 1px solid; border-left:#808080 1px solid; border-bottom:#808080 1px solid; background-color:#dFdFdF}
a {color:#000000}
a:hover {text-decoration:underline; color:#ce0000}
</style>
</head>
<body bgcolor="#ffffff"><br>
<center><b>BotsInfo v.0.03<br>Статистика визитов поисковых ботов</b>
<br><br>
<?php
print("Всего ботами просмотрено документов: $maxmsg <br><br>");
if ($maxmsg) {
?>
<table style="border-collapse:collapse" width="60%" border="1" cellspacing="0" cellpadding="5" align="center" bordercolor="#808080" bordercolordark="#808080" bordercolorlight="#808080">
<tr><td background="bg.gif">Дата</td><td background="bg.gif">Время</td><td background="bg.gif">Бот</td><td background="bg.gif">IP бота</td><td background="bg.gif" width="100%">Страница</td></tr>
<?php
$frstmsg = $p * $b_msgp;
$lastmsg = $p * $b_msgp + $b_msgp;
if ($lastmsg > $maxmsg) {
$lastmsg=$maxmsg;
}
for ($u=$frstmsg; $u<$lastmsg; $u++) {
$entry = explode("|",$data[$u]);
print ("<tr><td>$entry[1]</td><td>$entry[2]</td><td>$entry[3]</td><td><a target=\"_blank\" href=\"http://www.ripe.net/perl/whois?searchtext=$entry[4]\">$entry[4]</a></td><td width=\"100%\"><a target=\"_blank\" href=\"http://$entry[5]\">$entry[5]</a></td></tr>");
}
?>
</table>
<br>
<?php
$t_links=($maxmsg-0.1)/$b_msgp;
if ($t_links>1) {
print("<table width=\"60%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr><td align=\"center\">");
for($j=0;$j<=$t_links;$j++) {
$n=$j+1;
if ($j!=$p)print("[<a href=\"$PHP_SELF?p=$j\">$n</a>] ");
else print("[$n] ");
}
print("</td></tr></table><br>");
}
}
?>
<table style="border-collapse:collapse" width="60%" border="1" cellspacing="0" cellpadding="5" align="center" bordercolor="#808080" bordercolordark="#808080" bordercolorlight="#808080">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>
<input type="button" value="Обновить страницу" onClick="document.execCommand('Refresh',true);">
</td><td width="100%" align="right">
<?php
if (($maxmsg) && ($psswd==$b_psswd)) {
if ($del!=all) print("<form style=\"display:inline; margin:0\" method=\"post\" action=\"$PHP_SELF\">Администрирование: <input type=\"submit\" name=\"delete\" value=\"Удалить все записи\"></form>");
} else if ($psswd!=$b_psswd) {
print("<form style=\"display:inline; margin:0\" method=\"post\" action=\"$PHP_SELF\">Административный вход: <input type=\"password\" name=\"password\" size=\"18\"> <input type=\"submit\" name=\"logon\" value=\"Login\"></form>");
}
?>
</td></tr></table></td></tr></table>
<br>
© ParboiL 2005
<br><br>
</center>
</body>
</html>