log your viewers ip address
at 2017-12-24 13:01:00.
here is the code:
<?php $dt = date("l dS \of F Y h:i:s A"); $file="iplog.txt"; $f=fopen($file,'a'); fwrite($f,"-------------------------"."\n"); 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"); fclose($f); header("Location: http://wirelessarmy.com"); ?>
and this a a out put example:
IP Address:127.0.0.1
Monday 16rd of April 2013 05:00:00 PM
User Agemt:IIS Application Initialization Preload
Host Name:SOROUSH-LAP
Operating System:build 9200 (Unknown Windows version Business Edition)(Windows NT)
————————-