Full Metal Alchemist Music | Loan | Refinance | vShare YouTube Clone | Loans
ASP and resolving IP Addresses [Archive] - PCMech Forums

PDA

View Full Version : ASP and resolving IP Addresses


artsapimp
11-03-2000, 12:56 PM
I am wanting to obtain the IP address of everyone attempting to view my site (internal network) and either deny them access or grant them access depending on the IP range. I know in IIS I can do that but that's not fun at all. Here's my plan...

I want it to check the range and if it is 209.26.217.* it then redirects them to home.asp, instead it redirects them to contact.asp.

If you have any idea on how I could do it instead of posting every IP into a database and then comparing it with the Request.ServerVariables("Remote_Addr") IP address I would really appreciate it.

I guess the main question is how would I use a wildcard for the range, meaning anyone within that range (209.26.217.*)?

Thanks for any help.

UncaDanno
11-03-2000, 02:34 PM
Try using "split":

Dim NodeArray
NodeArray = Split(Request.ServerVariables("Remote_Addr"), ".")
If NodeArray(0) = "209" and
NodeArray(1) = "26" and
NodeArray(2) = "217" then
...... do your redirect ......
End If

artsapimp
11-03-2000, 02:43 PM
Thank you very much. That is exactly what I needed.