Using .htaccess 












Using .htaccess/.htpasswd Password Protection 





Coding Tips 








Uploads and Downloads 



Mail 
see it on this page





Working with Images 


Frequently Requested Website Functionality 
see it on this page
see it on this page
see it on this page
see it on this page











Using PHP 




Website Managment 








Other Tips 









Creating a custom php.ini file
You may want to use a custom php.ini file in order to change some of the host defaults. For example, you should ensure register_globals = off for improved script security. If you copy the default host file, make changes, and then put it in your webspace, you may not know if your host makes further changes to the default file which could cause your file to be out-of-date. A good solution is the following script, which you can execute manually or kick-off with cron each night. The script reads the host default file, makes your changes, and writes it to your directory. Now you can always have the current host default php.ini file with your changes made.
<?php
// Put all the php.ini parameters you want to change below. One per line.
// Follow the example format $parm[] = "parameter = value";
$parm[] = "register_globals = Off";
$parm[] = "session.use_trans_sid = 0";
// full unix path - location of the default php.ini file at your host
// you can determine the location of the default file using phpinfo()
$defaultPath = "/usr/local/lib/php.ini";
// full unix path - location where you want your custom php.ini file
$customPath = "/home/user/public_html/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
$contents = file_get_contents($defaultPath);
$contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n";
foreach ($parm as $value) $contents .= $value . " \n";
if (file_put_contents($customPath,$contents)) {
if (chmod($customPath,0600)) $message = "The php.ini file has been modified and copied";
else $message = "Processing error - php.ini chmod failed";
} else {
$message = "Processing error - php.ini write failed";
}
} else {
$message = "Processing error - php.ini file not found";
}
echo $message;
?>
