Answer the question
In order to leave comments, you need to log in
Why is the integral an area?
Good day. Explain why the definite integral is the area of a curved figure?
Answer the question
In order to leave comments, you need to log in
In general, as I already commented above, there is a request everywhere
or
Here it is pretty well stated.
With one "but" - MongoDB .
I think if you dig into the reference books (and they are also in Russian), then you can rewrite this under the DB provided by the hoster.
Yes, in the end, you can drive it all in, say, CSV.
But the easiest way is to run something like this on the server side:
<?php
$file="stat.log"; // файл для записи истории посещения сайта
$col_zap=500; // ограничиваем количество строк log-файла
function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) // Определяем IP
{ $ip=$_SERVER['HTTP_CLIENT_IP']; }
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }
else { $ip=$_SERVER['REMOTE_ADDR']; }
return $ip;
}
if (strstr($_SERVER['HTTP_USER_AGENT'], 'YandexBot')) {$bot='YandexBot';} //Выявляем поисковых ботов
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')) {$bot='Googlebot';}
else { $bot=$_SERVER['HTTP_USER_AGENT']; }
$ip = getRealIpAddr();
$date = date("H:i:s d.m.Y"); // определяем дату и время события
$home = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; // определяем страницу сайта
$lines = file($file);
while(count($lines) > $col_zap) array_shift($lines);
$lines[] = $date."|".$bot."|".$ip."|".$home."|\r\n";
file_put_contents($file, $lines);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question