Login Register


Basic IP Grabber filter_list
Author
Message
Basic IP Grabber #1
Code:
<?php //Stewie's IP Grabber //Variables $protocol = $_SERVER['SERVER_PROTOCOL']; $ip = $_SERVER['REMOTE_ADDR']; $port = $_SERVER['REMOTE_PORT']; $agent = $_SERVER['HTTP_USER_AGENT']; $ref = $_SERVER['HTTP_REFERER']; $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); //Print IP, Hostname, Port Number, User Agent and Referer To Log.TXT $fh = fopen('log.txt', 'a'); fwrite($fh, 'IP Address: '."".$ip ."\n"); fwrite($fh, 'Hostname: '."".$hostname ."\n"); fwrite($fh, 'Port Number: '."".$port ."\n"); fwrite($fh, 'User Agent: '."".$agent ."\n"); fwrite($fh, 'HTTP Referer: '."".$ref ."\n\n"); fclose($fh); ?>

As I said, basic.
Need help? PM me.
Want me to see your post? Quote me.

Liable to change unpredictably and rapidly, especially for the worse.

Reply

RE: Basic IP Grabber #2
Basic and yet you still stole it:

[Image: sKRpZTm0b8.png?]

Code:
<?php file_put_contents('log.txt',$_SERVER['REMOTE_ADDR'].PHP_EOL,FILE_APPEND); ?>

There is a oneliner to log just the ip without the cruft.
(This post was last modified: 05-05-2014, 06:32 PM by miiike980.)

Reply

RE: Basic IP Grabber #3
busted Tongue

Reply







Users browsing this thread: