Hi
I have a couple of phpbb forums on my web space.
One is randomly throwing people off and it is getting far worse.
I have traced down the issue to the IP address. Phpbb stores the IP address and session id and checks that they match. If not it throws the user out. The session ids seem to be there OK, but the IP addresses aren't.
When it causes a problem the IP address seems to be returned as "::" (yes, 2 colons).
I have used the following routine to try and obtain a relevant IP address and it to returns "::"
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
Any ideas?
All the best
Keith