Wireless Army
This is a blog / tips and tricks website for web developers and security researchers.
follow us in feedly

log your viewers ip address
by admin
 at 2017-12-24 08:01:00.

here is the code:

$dt = date("l dS \of F Y h:i:s A");
fwrite($f,"IP Address:".$_SERVER['REMOTE_ADDR']."\n");
fwrite($f, $dt."\n");
fwrite($f,"User Agemt:".$_SERVER['HTTP_USER_AGENT']."\n");
fwrite($f,"Host Name:".php_uname('n')."\n");
fwrite($f,"Operating System:".php_uname('v')."(".php_uname('s').")"."\n");
header("Location: http://wirelessarmy.com");

and this a a out put example:

IP Address:
Monday 16rd of April 2013 05:00:00 PM
User Agemt:IIS Application Initialization Preload
Operating System:build 9200 (Unknown Windows version Business Edition)(Windows NT)