اسکریپت بستن “آی پی javascript

<head>
<script language=”JavaScript” type= “text/javascript” >

var banned_ip_page = “http://www.google.com”; // This is the page to direct to if the ip is banned

// get the visitor’s IP address

var visitor_ip = ‘88.176.68.51’; // This is the visitor’s IP address as returned by the server

// User defined test – add as many groups as you need for all the banned ips;
// Make sure you modify these example ip addresses and do not lock yourself out.
// The || (vertical bars or pipe lines) mean “or” and the == is used to test equality
// Each individual test is enclosed in parentheses
// The entire set of tests is enclosed in parentheses

if ( // opening parenthesis for the entire test

// You may change the tests from here
(visitor_ip == “88.176.68.51” )
|| (visitor_ip == “198.74.51.33” )
|| (visitor_ip == “198.74.61.68” )
|| (visitor_ip == “66.55.61.68” )
// until here …

) // closing parenthesis for the entire test
{ alert(“Sorry, your IP has been banned from this site”);
document.location = banned_ip_page; }
</script>
</head>