Forum Moderators: coopster

Message Too Old, No Replies

Tracking script shows host as "localhost"

What does it mean?

         

Patrick Taylor

8:20 pm on Nov 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using this in my visitor tracking script:


// Get host
if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]!= ""){
$IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
$proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$host = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);
} else {
$IP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
$host = @gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);
}

Today I see more hits than usual and a lot of lines like:


ie 5.5 Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
Host: localhost

I don't understand why "localhost" would be shown as the host instead of the more usual "161.xx.xx.xx", "some.host.example.pl" etc. Would anyone please be able to clarify this for me?

My other tracking system shows the same host as "64.xx.xx.xx".

Many thanks.

[edited by: jatar_k at 12:25 am (utc) on Nov. 18, 2004]
[edit reason] generalized ip [/edit]

coopster

4:24 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Did you ever get anywhere with this? You're sure it wasn't an internal process, thereby sending 127.0.0.1 as the REMOTE_ADDR?

Patrick Taylor

5:36 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I never got anywhere. I saw this in my tracking script page - in many external hits to my pages on one particular day - and I was (and still am) curious about the 'localhost' thing, which I've never seen before in my logs.