Advertisement
fqrmix

IPlogger

Oct 28th, 2016
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php
  2. $ip = $_SERVER["REMOTE_ADDR"];
  3. $browserandos = $_SERVER['HTTP_USER_AGENT'];
  4. $referalka = $_SERVER['HTTP_REFERER'];
  5. if (!empty($ip)) {
  6.    $details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
  7.    $hostname=gethostbyaddr($ip);
  8. }
  9. $date = date("Y-m-d H:i:s");
  10. $file = fopen("ipshniki.txt","a+");
  11.     fwrite($file,"-----------------"."\r\n");
  12.     fwrite($file,"IP: ");
  13.     fwrite($file,$ip."\r\n");
  14.     fwrite($file,"Hostname: ");
  15.     fwrite($file,$hostname."\r\n");
  16.     fwrite($file,"Date: ");
  17.     fwrite($file,$date."\r\n");
  18.     fwrite($file, "Country: ");
  19.     fwrite($file,$details->country."\r\n");
  20.     fwrite($file,"City: ");
  21.     fwrite($file,$details->city."\r\n");
  22.     fwrite($file,"Region: ");
  23.     fwrite($file,$details->region."\r\n");
  24.     fwrite($file,"Internet provider: ");
  25.     fwrite($file,$details->org."\r\n");
  26.     fwrite($file,"Browser and OS: ");
  27.     fwrite($file,$browserandos."\r\n");
  28.     fwrite($file,"Where he got link: ");
  29.     fwrite($file,$referalka."\r\n");
  30.     fwrite($file,"-----------------");
  31. fclose($file);
  32.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement