Computer information



  • Hello, Master! We need to write a viol that, when we get on the site, will record ip.txt data for example:

    1* 13:55 23.11.11 Windows Xp SP3 Opera 127.0.0.1 Beeline Stavropol Russia<br/>
    2* 10:16 22.11.11 Linux Mandriva Mazila 127.0.0.1 MTS Moscow Russia<br/>
    

    Something like that should happen... Every walk on the page
    Thank you.



  • <?php
    $log = "ip.txt"; //файл для логов
    $ip = $_SERVER['REMOTE_ADDR']; //айпи адрес
    $agent = $_SERVER['HTTP_USER_AGENT']; //лузерагент
    $date = date("F j, Y, g:i a"); //дата в формате March 10, 2001, 5:16 pm
    
    $fp = fopen($log, 'a'); //открываем фаел на дозапись (в конец файла)
    fwrite($fp, $date2.$ip.$agent."\n"); //пишем дату-переменную в которой айпи и агент
    fclose($fp); //закрываем фаел
    
    ?>
    

    // For further details (for other parameters) googled the contents of the $_SERVER, take the data from there and record it in the phase. There'll be questions, write.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2