I have a script "logger.php" which includes the following code:
PHP Code:
if ($HTTP_VIA)
{
*****proxy = "Y";
if (strpos($HTTP_X_FORWARDED_FOR,','))
{
$HTTP_X_FORWARDED_FOR = substr($HTTP_X_FORWARDED_FOR,0,strpos($HTTP_X_FORWARDED_FOR,',') );
}
*****addy = $HTTP_X_FORWARDED_FOR;
if(*****addy == "")
*****addy = getenv("REMOTE_ADDR");
}
else
{
*****proxy = "N";
*****addy = getenv("REMOTE_ADDR");
}
If I execute the script standalone it returns:
proxy = Y and hitaddy is my "REAL" IP address
If I include the script in another file (HTML) with:
PHP Code:
<?PHP include "/logger.php"; ?>
It returns
Proxy = N and the hitaddy is the "PROXY" NTL one!
Why? and how do I fix it!?