12-30-2011، 09:28 PM
n be used within a current page, or added to a site via an IFrame. (maybe other ways to implement too?)
Auto Creates log.html,if file does not exist.
کد:
<?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);
?>