View Single Post
Old 19-08-2004, 04:01   #4
Frank
Inactive
 
Join Date: Jun 2003
Location: Toronto, Canada
Services: Beanfield 50/50 FTTH and iPTV
Posts: 1,756
Frank has a golden auraFrank has a golden auraFrank has a golden auraFrank has a golden aura
Frank has a golden auraFrank has a golden aura
Re: Remote IP addy on page?

I'm not sure how to do this with SSI (or if you can) as it's so old

This can be done very easily on PHP however, just a few line of code to tes the variables and to display them as explained in Paul's link.

E.G.

PHP Code:
<?php
     
if (getenv(HTTP_X_FORWARDED_FOR)) { 
    
//get past a proxy addy
    
$ip=getenv(HTTP_X_FORWARDED_FOR); 
    } else { 
    
//normal ip addy
    
$ip=getenv(REMOTE_ADDR); 
    }
    echo 
"$ip";
    
?>
Some caches did return the IP address backwards at one point, but I believe his was fixed.
Frank is offline   Reply With Quote