Total members 11893 |It is currently Tue Nov 05, 2024 8:45 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 ??     -  
 Get IP address code     -  
 Find MAC Address     -  
 change the MAC address     -  
 Get Server address     -  



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