Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Remote Ip Address

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
I am having an issue on a few pages. I have an intranet site where I only want to allow pages to load if the person accessing the site is on the internal network.

So I am using the REMOTE_ADDR servervariables value to get the IP. The problem is that if I access the site from an external location, this just returns the gateway IP address which is on the internal network and so the page loads.

Have googled this and haven't found a solution. Is there a way around this? For the moment, I have just modified my check to only load if the REMOTE_ADDR is on the network and not the gateway address.

Mighty
 
Check if the REMOTE_ADDR is the local gateway IP and block access.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Did that in the end - thanks

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top