Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ip = $_SERVER["REMOTE_ADDR"];
- $browserandos = $_SERVER['HTTP_USER_AGENT'];
- $referalka = $_SERVER['HTTP_REFERER'];
- if (!empty($ip)) {
- $details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
- $hostname=gethostbyaddr($ip);
- }
- $date = date("Y-m-d H:i:s");
- $file = fopen("ipshniki.txt","a+");
- fwrite($file,"-----------------"."\r\n");
- fwrite($file,"IP: ");
- fwrite($file,$ip."\r\n");
- fwrite($file,"Hostname: ");
- fwrite($file,$hostname."\r\n");
- fwrite($file,"Date: ");
- fwrite($file,$date."\r\n");
- fwrite($file, "Country: ");
- fwrite($file,$details->country."\r\n");
- fwrite($file,"City: ");
- fwrite($file,$details->city."\r\n");
- fwrite($file,"Region: ");
- fwrite($file,$details->region."\r\n");
- fwrite($file,"Internet provider: ");
- fwrite($file,$details->org."\r\n");
- fwrite($file,"Browser and OS: ");
- fwrite($file,$browserandos."\r\n");
- fwrite($file,"Where he got link: ");
- fwrite($file,$referalka."\r\n");
- fwrite($file,"-----------------");
- fclose($file);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement