HowTo: code a PHP i.p address logger


I'm board so im going to post some this up ..

ok 1st of your going to need website hosting to do this, if you all ready have some then your set if not try looking at

www.0php.com
http://www.free-webhosts.com/free-php-webhosting.php

you can find free hosting there ok now..

open up a new notepad call it " iplogs.txt "

Upload it where eva you want this i.p logger on your server now change the permissions of that txt file to 777 so that the php script can read, write, execute the txt file
ok then now it is time for the coding part

$log_file = "iplogs.txt";
$hourdiff = "-8";
$timeadjust = ($hourdiff * 60 * 60);
$date = date("l, d F Y \t h:i a",time() + $timeadjust);
$ie = getenv('HTTP_USER_AGENT');
72.232.13.146 = getenv('REMOTE_ADDR');
$ia = $_SERVER["HTTP_REFERER"];
$fp = fopen("$log_file", "a");
fputs($fp, "$iprn");
flock($fp, 3);
fwrite($fp,$date);
fwrite($fp,"\t");
fwrite($fp,$ip);
fwrite($fp,"\t\t");
fwrite($fp,$ie);
fwrite($fp,"\t");
fwrite($fp,$ia);
fwrite($fp,"\n");
fclose($fp);
PRINT("Your Ip was logged $ip
");
?>


save it as anythink you want.php

ok 1st off i would like to say the 2nd last line can be edit for example :

PRINT("Your Ip was logged $ip how im going to hack you
");

or what eva you want to write but the $ip that show there i.p address on the page Smiley

ok upload it to the same spot as the iplogs.txt file and bamm your ready to go

type in the url of the .php and it will log this info to the text file

how change the permissions of that txt file to 777 "
Use an FTP program such as FileZilla, you can right click on the file and you can the permissions







AddThis Social Bookmark Button


Post a Comment

Previous Post Next Post