Support Forums

Full Version: IP Logger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This script when put on a website will write the ips of all visitors and write to log.html, it will create a link to an ip database website. Make sure you have created log.html and that you have set the permisions so it can be writen.

      $logfile= 'log.html';

      $IP = $_SERVER['REMOTE_ADDR'];

      $logdetails=  date("F j, Y, g:i a") . ': ' . '<a href='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>';
      $fp = fopen($logfile, "a");

      fwrite($fp, $logdetails);
      fwrite($fp, "<br>");

That's hot, I saved this. Big Grin
Thanks for this tut ive always wondered how to get a persons ip in php i kew how to save it but not how to retrive it thanks agian!
no problem
I'll eventually post one of these for python soon.
Nice post
Thanks for this.
Thanx...for this u must get a +rep
thanks all Big Grin