Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

True IP Host Getter

Code Wizard, 12-30-2006

A sure fire way to get a users IP and HOST NAME nomatter the servers setup. Takes into account a users possible ISP's Cache Server. (of course it's not perfect but ... nothing is). When saying 'True' we mean joe@AOL, not m1kef00@hacker.

After further review, this sucks. It should work but is not as useful as originally thought.

<?php
# do whatever you want with this, just don't take
# it as your own. (philip @ theprojects.org)
# use at own risk.
# This is not as useful as originally thought.

if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARD_FOR);
}
if (!$ip)
$ip = $REMOTE_ADDR;
}
$host = gethostbyaddr($ip);

?>


Still looking into this one, not sure if it is all that useful anymore - it could actually not work (the HTTP_X_FORWARDED_FOR part) very well, damn.
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions