[PHP] Basic IP log

Reputation
0
This will log each ip into a text file, does not check for duplicates.


PHP:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$d = date("d-m-y / H:i:s");
$log = $d . " -- " . $ip ."<br />";
$fopen = fopen("logs.html", "a");
fwrite($fopen, $log);
fclose($fopen);
?>
 
Wow dude thanks for sharing it, this will be really helpfull for my forum so i can rid off forum spammers ;D.
 
GAMEKINGZ said:
Wow dude thanks for sharing it, this will be really helpfull for my forum so i can rid off forum spammers ;D.

No problem, you can check if they are already logged with a simple file search function, but yeah you're welcome :)
 
Back
Top