function Cable Address

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Bomas
Forum Newbie
Posts: 24
Joined: Sun Oct 17, 2004 2:41 am
Location: Heverlee, Belgium

function Cable Address

Post by Bomas »

Can somebody help me, I'm looking for the code the see the cable address of a specific user.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

If I understand the question:

Code: Select all

echo "Your IP Address is: " . $_SERVER['REMOTE_ADDR'];
For more information take a look at this php.net page.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

maybe you're wanting to know the "physical" location of the IP? [google]geoip[/google]
User avatar
Bomas
Forum Newbie
Posts: 24
Joined: Sun Oct 17, 2004 2:41 am
Location: Heverlee, Belgium

Post by Bomas »

No the function i'm looking for is to see the ip address from an ADSL user. It changes everytime they register on the web. But they also have a fixed ip address, and thats what i need. I wonna use it to ban some users from a game I'm making with a friend
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

Code: Select all

// try these, maybe one will contain what you want

$_SERVER['HTTP_X_FORWARDED_FOR'];
$_SERVER['HTTP_X_FORWARDED'];
$_SERVER['HTTP_FORWARDED_FOR'];
$_SERVER['HTTP_FORWARDED'];
$_SERVER['HTTP_X_COMING_FROM'];
$_SERVER['HTTP_COMING_FROM'];
$_SERVER['HTTP_CLIENT_IP'];
$_SERVER['HTTP_VIA'];
$_SERVER['REMOTE_ADDR'];
User avatar
Bomas
Forum Newbie
Posts: 24
Joined: Sun Oct 17, 2004 2:41 am
Location: Heverlee, Belgium

Post by Bomas »

Guys, you don't have to search anymore. I found what I was looking for, it was this function: gethostbyaddr($_SERVER['REMOTE_ADDR']);
Thanks anyway.
Post Reply