PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP Get Hostname Behind Proxies
Your Ad Here

Get Hostname Behind Proxies


Get Hostname Behind Proxies This is a very simple code and works for anybody who is behind proxies and people who are not. This might be usfull if your have cable users visiting your site.

<?php $ip = getenv('REMOTE_HOST');
if(!$ip) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
if(!$ip) {
$ip = $HTTP_X_FORWARDED_FOR;
}
if(!$ip) {
$ip = getenv('REMOTE_ADDR');
}
if(!$ip) {
$ip = $REMOTE_ADDR;
}
$ip = @GetHostByAddr($ip);
echo $ip;
?>


Author's URL: Andrew Makowsky
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Web programming � everything from the basics of visual design and architecture to the specifics of applications, graphics, and scripting. More Web Programming: Most Popular Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

Add comments to "Get Hostname Behind Proxies"

Only registered users can write comment

Reader's comments