Code subject: ban visitor from a specific IP-address
Posted: Sun Apr 03, 2011 11:00 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2272 Location: Earth Has thanked: 39 time Have thanks: 61 time
Following code ban visitor from a specific IP-address to view your page content .
Code:
<% 'variables to store banned IP and the users IP Dim strUserAddress , strBlockedIP ' just imagine that this is a banned IP address strBlockedIP="147.3.3.1" ' retrieve the user IP address , strUserAddress = Request.ServerVariables("LOCAL_ADDR") 'if page visitor address equals to banned IP address 'condition and print error message for visitor . If strBlockedIP= strUserAddress Then Response.Write "Error : Your IP address is not allowed to see this page." 'If IP address is not banned. Else Response.Write "<b>Page content </b>" End If %>
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
okdie
Code subject: Re: ban visitor from a specific IP-address
Posted: Mon Jan 02, 2012 6:51 pm
What if want to allow specific IP to view and specific page?