Check out my twitter script by CMXads
Sell your soul Believeth in me an hath everlasting life | PHP Gallery PHP Gallery is a free php image script. | Sharp Stuff Switchblades Icepicks and german knives | Viking gear Gear Gifts and Apparel |
here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.
Block visitors by host extention. create text file and load with extentions on each line. or create array in this file
include this in the top of your pages or config file.
host extension block
create a text file
.de
.ru,
.jp
.gov
phpstart
$ip = $_SERVER['REMOTE_ADDR'];
$key = gethostbyaddr($ip);
$db="banhost.data";
$fc=file("$db"); //load file into array
$f=fopen("$db","r"); //open same file and use "r" to read file
while (!feof($f) ) {
$line_of_text = fgets($f);
$check = substr ($key, -4); //look for match 4 char from end
if (stristr($line_of_text,$check)) //look for $key in each line if match
{
echo "banned";
@mail('you@you.com','ban host','Hi, \n\r webmaster \n\r visitor banned by host.');
exit();
}
}
fclose($f);
phpend