Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
Log visitor IP or Hostname to html fileCode Wizard, 12-30-2006 |
Script Note:
This script will log the users Hostname to a html file. If it can't resolve their hostname, it will just log their IP. You'll need a file called visitors.html and you should chmod visitors.html to 777. When you want to view your visitors, just view visitors.html. You can just copy this code and past it into your html. Whenever somebody visits your page, it will get their IP or Hostname and log it to visitors.html.
To the code!!!
<?
if ($REMOTE_HOST == "") $visitor_info = $REMOTE_ADDR;
else $visitor_info = $REMOTE_HOST;
$fp = fopen("visitors.html", "a");
fputs($fp, "· $visitor_info<br>
");
fclose($fp);
?>
That's it. Pretty darn simple.
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

