Basic IP Grabber 05-05-2014, 06:27 PM
#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.
Want me to see your post? Quote me.
Liable to change unpredictably and rapidly, especially for the worse.
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
![[Image: sKRpZTm0b8.png?]](http://ss.0x0539.net/sKRpZTm0b8.png?)
