954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Blocking an IP adress to a certain page

0
By Muhammad Saqib on Nov 6th, 2005 4:40 pm

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.

<%
'''''''''''''''''''''''''''''''
' Block the IP addresses that do the SPAM
'''''''''''''''''''''''''''''''
Function IsBlockedIP()
	Dim UserIP 
	Dim BlockedIParray(2) 
	'assign our blocked IP addresses to our array
	BlockedIParray(0) = "60.0.201.209" 
	BlockedIParray(1) = "218.11.15.212" 
	'retrieve the visitors IP address
	UserIP = Request.ServerVariables("REMOTE_ADDR") 

	'loop through the Blocked IPs 
	For i = 0 to UBound(BlockedIParray) 
		If UserIP = BlockedIParray(i) Then 
			Response.Redirect "index.asp" 
			'Response.Redirect "noaccess.asp" 

		End If 
	Next 
End Function
%>

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

perosf
Newbie Poster
24 posts since Sep 2009
Reputation Points: 10
Solved Threads: 1
 

thanks

yonker
Newbie Poster
13 posts since Oct 2009
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You