Using .htaccess 












Using .htaccess/.htpasswd Password Protection 


php5
php5
Coding Tips 






Uploads and Downloads 

php5
php5
php5
Mail 



php5


Working with Images 


Frequently Requested Website Functionality 
php5
php5

php5 see it on this page
php5








Using PHP 
php5
php5
php5


Website Managment 







php5

php5
Other Tips 







Ban or allow IP Addresses (not using htaccess)
While a .htaccess file can be used to ban or allow, it cannot be selective by function. This is something you can easily do with a script.
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ipArray = preg_replace("#\r\n?|\n#","",file('IP.dat')); // read the file into an array and remove new line breaks (should cover all OS)
foreach ($ipArray as $ipTest) {
if (substr_count($ip, $ipTest) != "0") {
header('location: /banned.htm'); // the banned display page
die();
}
}
?>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ipArray = preg_replace("#\r\n?|\n#","",file('IP.dat')); // read the file into an array and remove new line breaks (should cover all OS)
unset($allowed);
foreach ($ipArray as $ipTest) if (substr_count($ip, $ipTest) != "0") $allowed = "yes";
if ($allowed != "yes") {
header('location: /banned.htm'); // the banned display page
die();
}
?>