Blocking an IP adress to a certain page

msaqib msaqib is offline Offline Nov 6th, 2005, 6:40 am |
0
This is a small function that will block the specific IP from viewing the certain page, and it will redirect the user to the main page or noaccess page.
Quick reply to this message  
ASP Syntax
  1. <%
  2. '''''''''''''''''''''''''''''''
  3. ' Block the IP addresses that do the SPAM
  4. '''''''''''''''''''''''''''''''
  5. Function IsBlockedIP()
  6. Dim UserIP
  7. Dim BlockedIParray(2)
  8. 'assign our blocked IP addresses to our array
  9. BlockedIParray(0) = "60.0.201.209"
  10. BlockedIParray(1) = "218.11.15.212"
  11. 'retrieve the visitors IP address
  12. UserIP = Request.ServerVariables("REMOTE_ADDR")
  13.  
  14. 'loop through the Blocked IPs
  15. For i = 0 to UBound(BlockedIParray)
  16. If UserIP = BlockedIParray(i) Then
  17. Response.Redirect "index.asp"
  18. 'Response.Redirect "noaccess.asp"
  19.  
  20. End If
  21. Next
  22. End Function
  23. %>
0
perosf perosf is offline Offline | Sep 28th, 2009
I think I finished work this code. I want to restrict a page where someone comes from abroad to show another page and when the national network to the actual page opens.
This code which should be put in the php file?
I'm not familiar so much for help.
Thank you
 
0
yonker yonker is offline Offline | Oct 20th, 2009
thanks
 
 

Message:


Similar Threads
Thread Tools Search this Thread



Tag cloud for ASP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC