Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100 off


PHP Tutorials and Scripts   




Title: Block Any ISP    Marked Cool    (Review this resource)
Author: GameGuy
Posted On: 2004-11-28
Category: Home > PHP Applications

Popularity: 1 points out of 10    

Description: This small script will block any ISP from your site. Just insert it to your index.php file and enjoy! :)

Total Hits: 885     Total Votes: 0     Total Points: 0 (1 reviews)        [ Print ]   

Page Navigation:  [1]


Block Any ISP




It's a small and powerfull script. It provides you a feature of blocking any ISP from your website. What you have to do is, just insert it to your home page (i.e. index.php) file and enjoy! :)

Code is:


<?php


#This should be at the top of your main "index" page.
#It'll give a fake "404 Not Found" to the browser.
#DESCRIPTION: WILL BLOCK ANY ISP FROM YOUR SITE ;)! JUST ENTER THE URL!
$hn gethostbyaddr($REMOTE_ADDR);
if (
stristr($hn"aol.com")) {
    
Header("HTTP/1.1 404 Not Found");
    print 
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
        <HTML><HEAD>
        <TITLE>404 Not Found</TITLE>
        </HEAD><BODY>
        <H1>Not Found</H1>
        The requested URL / was not found on this server.<P>
        <P>Additionally, a 404 Not Found
        error was encountered while trying to use an ErrorDocument 
                to handle the request.
        <HR>
        <ADDRESS>Apache/1.3.26 Server at <yourdomain.com> Port 80</ADDRESS>
        </BODY></HTML>"

    exit;
}
?> 


Page Navigation:  [1]



© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.