/ Published in: PHP
URL: http://mark.haktstudios.com/
Requires Apache, does not yet handle IP addresses with wildcards in them, that'll be in the next version
Expand |
Embed | Plain Text
<?php /****************************************************************************** Configuration /******************************************************************************/ $admin_mail = 'admin@localhost'; // admin's email address /****************************************************************************** Read Ban List from .htaccess ( so essentially, if they used a proxy and apache misses it, the script can do a second check ) /******************************************************************************/ foreach($ban_list as $line) { if (stripos($line, "deny from") !== false) { { } } } /****************************************************************************** get_ip() - Attempts to retrieve the most accurate IP possible from user. /******************************************************************************/ function get_ip() { { { return $_SERVER['X_FORWARDED_FOR']; } } return $_SERVER['REMOTE_ADDR']; } $ip = get_ip(); { echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>ERROR: 403 Forbidden - You have been banned!</title> <style type="text/css"> </style> </head> <body> <h1>ERROR: 403 FORBIDDEN</h1> <p> It appears that your IP ( '.$ip.' ) has been banned from accessing this sites content. If you feel that this banning is in error, feel free to contact the sites administrator to have it removed. </p> <p>Admin Contact: <a href="MAILTO:'.$admin_mail.'">'.$admin_mail.'</a></p> </body> </html> '; } // clean up variables /* end of file */
You need to login to post a comment.
