![]() |
|
IP grabber script - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: PHP (https://sinister.li/Forum-PHP) +--- Thread: IP grabber script (/Thread-IP-grabber-script) |
IP grabber script - unixbreak - 11-23-2012 PHP Code: <head><?php$ip = $_SERVER['REMOTE_ADDR'];
$time = date("l F dS h:i:s A Y");
$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER'];
$myFile = "xxxx.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "$time\n";
fwrite($fh, $stringData);fclose($fh);
$myFile = "xxxx.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "$ip\n";
fwrite($fh, $stringData);
fclose($fh);
$myFile = "xxxx.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "$hostaddress\n";
fwrite($fh, $stringData);
fclose($fh);print "<strong> </strong><br />\n"; if ($referred == "") {print ""; }else {print "$referred";}?><!-- Redirectng to a different page (this is optional just delete this javascript if u dont want to redirect) --><script type="text/javascript"><!--window.location = "http://www.google.com/"//--></script></head><body></body></html>
RE: IP grabber script - LightX - 11-23-2012 Lol thats a wide thread. Oh well. thanks! :epic: RE: IP grabber script - unixbreak - 11-23-2012 re-edited * sry for the original post lol RE: IP grabber script - LightX - 11-23-2012 (11-23-2012, 11:47 PM)unixbreak Wrote: re-edited * sry for the original post lol Haha much better! Thankz
|