gusl: (Default)
[personal profile] gusl
< ? 
#header("Content-Type: text/html");

$handleStr = "/home/username/public_html/log.txt";

$handle = fopen($handleStr, "a");

  $ip = $_SERVER['REMOTE_ADDR'];
  $fullhost = @gethostbyaddr($ip); 

#IP address: $_SERVER['REMOTE_ADDR']
#see http://nl3.php.net/reserved.variables

if ($_SERVER['REMOTE_ADDR'] != "121.11.1.11" && $_SERVER['REMOTE_ADDR'] != "212.22.22.212") #ignore my own home hits
{                
  fwrite($handle, strftime("%d/%b/%Y %I:%M'%S %p") . " ");
  fwrite($handle, "page " . $_SERVER['PHP_SELF']);
  fwrite($handle, "     referrer: " . $_SERVER['HTTP_REFERER']);
  fwrite($handle, "\n");
  fwrite($handle, "browser=[" . $_SERVER['HTTP_USER_AGENT'] . "]");
  fwrite($handle, "\n");
  fwrite($handle, "remote_host= \"" . $_SERVER['REMOTE_HOST'] . "\"");
  fwrite($handle, "  fullhost=" . $fullhost . " (" . $ip . ")\n");
  fwrite($handle, "\n");
  fwrite($handle, "\n");
}

fclose($handle);
? >

(no subject)

Date: 2005-09-13 09:12 am (UTC)
From: [identity profile] gustavolacerda.livejournal.com
Yeah... it seems the web server should do this for me automatically. Thanks for the tips. I'm going to look up these two.

One difference, though, is that I'm interested in individual visitors. I'd like to change my signature on every email, in order to see who saw what.
http://www.optimizelife.com/index.php#peamasii130905

Then I can associate the IP with the person, and if they visit again spontaneously, that's probably a sign that they liked my site.

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags