Total members 11871 |It is currently Sun Aug 07, 2022 9:21 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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 
%>
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

What if want to allow specific IP to view and specific page? :duel:



Author:
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : ban visitor from a specific IP-address
 log visitor IP address.     -  
 Specific Colors for Specific Forum     -  
 Display Visitor's Local Time (IPv6 supported)     -  
 what is MAC address     -  
 Reading a Specific Character in php     -  
 how to get Color name from a specific pixel ??     -  
 Find MAC Address     -  
 change the MAC address     -  
 Get Server address     -  
 Get IP address code     -  



Topic Tags

ASP Networking
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com