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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only allow certain access via IP address

Status
Not open for further replies.

apex82

Programmer
Mar 2, 2009
127
GB
I have the following code that I am using to try to only allow access to a page to users with a certain IP address.

Code:
<%
Select Case Request.ServerVariables("remote_addr")
Case "[COLOR=red]ip address[/color]"
Case Else
Response.Redirect "[URL unfurl="true"]http://www.google.co.uk/"[/URL]
Response.End
End Select
%>

This doesn't appear to work when the correct ip is used, it always re-directs to google rather than allowing accessing to the page. 

Can anyone help?

Thanks.
 
This does actually work!

I had the include file link in the incorrect place. Doh..
 
mmmmmm, if those remote users are on a LAN they probably have an internal (local) IP-address. Their LAN is connected to internet via firewall/proxy/isa server(s) and all traffic will come trough there. You only 'see' the IP address of their firewall/proxy/isa (or whatever device they use) ....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top