Forum Moderators: open

Message Too Old, No Replies

how to use if statement to check if value contains.

         

ahmed24

9:46 am on Jul 20, 2006 (gmt 0)

10+ Year Member



Hello,

I have the following if statement that checks to see if the visitors IP address is 192.168.0.1 and if so i display something, if not then i display something else.

<% If Request.ServerVariables("REMOTE_ADDR") = "192.168.0.1" Then %>

But i want to use the if statement to check if REMOTE_ADDR starts with "192." or contains the phrase "192." at the moment it's checking to see if it is equal to.

Can anyone tell me how this can be done?

Thanks

Jimmy Turnip

12:35 pm on Jul 20, 2006 (gmt 0)

10+ Year Member



If InStr(Request.ServerVariables("REMOTE_ADDR"), "192.") > 0 Then

paulanthony

5:37 pm on Jul 20, 2006 (gmt 0)

10+ Year Member



Surely this would match

127.192.54.3

Is this not an Internal IP address thing your working on...or am I over assuming..