Forum Moderators: DixonJones

Message Too Old, No Replies

This Forms Logging System

         

smoky

3:31 pm on Jan 3, 2005 (gmt 0)

10+ Year Member



hey...

I just thought id tell you that your IP logging system doesnt seam to work. Well it does but it is getting the wrong IP address.

If anyone here is using NTL World ISP service you should know that NTL run a cache system. & guess what, your IP logger seams to be gathering the cache system IP address..

I believe im correct... I noticed this when i signed up and sore that the address you said i was wasnt me. NTL client addresses start with 82 and the address you pointed me to was a 64 address.

In PHP you would gather the right IP address by:


if (getenv("HTTP_CLIENT_IP"))
{
$ip = getenv("HTTP_CLIENT_IP");
}
else if(getenv("HTTP_X_FORWARDED_FOR"))
{
$ip = getenv("HTTP_X_FORWARDED_FOR");
}
else if(getenv("REMOTE_ADDR"))
{
$ip = getenv("REMOTE_ADDR");
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}

$ISP = gethostbyaddr($_SERVER['REMOTE_ADDR']);

The $IP would hold the correct IP address of the Client and the $ISP would hold the ISP address of the client. I hope this helps Webmaster World improve security...

Brett_Tabke

10:36 pm on Jan 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



we have to use the ip that is used for the http communications. Regardless, we base nothing "security" wise on specific ip addresses just because of the proxy server situation. What is right for one isp is not for another.

smoky

2:09 pm on Jan 4, 2005 (gmt 0)

10+ Year Member



Thats a same... Just isnt pin point :)