Print Page | Close Window

plz help. english to ASP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=21782
Printed Date: 29 March 2026 at 7:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: plz help. english to ASP
Posted By: pro_touch
Subject: plz help. english to ASP
Date Posted: 30 October 2006 at 8:40am
can any one translate this sentence in ASP language . programmers will understand what i want.
 
 
IF
    first first three numbers of IP Address of the users is not 111 then
    response.write "Allowed"
End If
 
 
There is no "else" in this condition. just want to avoid the banner if the ip address contains my cable net ip address or let say local so just tranlate that line for me plz.
 
Thank you.



Replies:
Posted By: dpyers
Date Posted: 30 October 2006 at 4:35pm
dim strIP_Addr
strIP_Addr = Trim(Request.ServerVariables("REMOTE_ADDR"))

If strIP_Addr > "" AND Len(
strIP_Addr) >2 Then
   If Left(strIP_Addr,3) <> "111" Then
      Response.Write strIP_Addr & " is Allowed"
   End If
Else
   Response.Write "Invalid or Masked IP Address - " & strIP_Addr
End If


The 2nd If is what you asked for but I wrapped it in another If to check that the IP wasn't blank or Null or less than 3. Some anti-virus programs and some browsers can be configured to send an empty ip address.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: pro_touch
Date Posted: 31 October 2006 at 12:29am

thanks alot. :) Smile




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net