dipman44
07-08-2007, 05:03 PM
how would a write a script that will log ip addresses on to a txt or something if they visit a certain page?
Moonbat
07-08-2007, 08:08 PM
A simple Google of "IP Logger in PHP" gave me this PHP code.
<?php
$logfile= '/full_path_to/log.html';
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http://dnsstuff.com/tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>';
$fp = fopen($logfile, "a");
fwrite($fp, $logdetails);
fwrite($fp, "<br>");
fclose($fp);
?>
Powered by vBulletin® Version 4.1.8 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.