$_SERVER['REMOTE_ADDR'] Issue

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
mlpnyc
Forum Newbie
Posts: 2
Joined: Tue Mar 02, 2010 1:14 pm

$_SERVER['REMOTE_ADDR'] Issue

Post by mlpnyc »

Hey, all.

First post to the forums here. Thanks, in advance, for any help with my issue.

I'm using the $_SERVER['REMOTE_ADDR'] command to get the IP address of the visitor to my page, but it's returning only the local IP address for the web server (e.g. 12.0.0.1), regardless of where the site is hit from and what network is being used for the hit. Can someone point me in the direction of the error in either the config or the code? I need to be able to see story hits that occur in-hosue versus those from external computers.

Thanks so much for the help.

Michael
New York, NY.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: $_SERVER['REMOTE_ADDR'] Issue

Post by greyhoundcode »

I take it your website is accessible on the web, it isn't on a local development server?
mlpnyc
Forum Newbie
Posts: 2
Joined: Tue Mar 02, 2010 1:14 pm

Re: $_SERVER['REMOTE_ADDR'] Issue

Post by mlpnyc »

greyhoundcode wrote:I take it your website is accessible on the web, it isn't on a local development server?
That's correct.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: $_SERVER['REMOTE_ADDR'] Issue

Post by greyhoundcode »

Are your other $_SERVER indices as expected? Like HTTP_USER_AGENT?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: $_SERVER['REMOTE_ADDR'] Issue

Post by Benjamin »

Post Reply