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 









Delete session files
If you are using a custom php.ini file to specify a user directory where session files are stored, this script can be used to delete old session files (the system will not purge them, so the directory will keep growing if you do not delete them). You must change the $sessionDir variable to the path where your session files are stored, and you can adjust the delete time frame as well (the example below uses 3 hours - you would not want to delete an active session). You can run this script directly or set it up to run at specific time intervals using cron.
<?php
$sessionDir = "/home/user/temp/"; // your sessions directory
$compareTime = time() - 10800; // 3 hours
$count = 0;
foreach (glob($sessionDir."*.sess") as $file)
if ($compareTime >= filemtime($file))
if (unlink($file)) $count++;
echo "$count session files were deleted";
?>




