DL Download Logger -------------------------------------------------- DL is a tool to log downloads from your site. You can specify a regex to allow only request coming over your site. This way your files are only available thru your site, and you spare traffic. Setup -------------------------------------------------- Just set up the variables in dl.php. 1. You domain: $domain = "(www.mydomain.com)"; // The allowed IP or URL. Build your own regex if you need to. 2. The path under which the downloadable files are stored, relatvly to your domain: $download_path = "/download"; // The directory were your download files reside. 3. An array of you download files. Only files stored in this array will be downloadable: $download_files = array ("1.exe", // List all your download files here. "2.zip", "3.rar"); 4. The web page, from where you link to dl.php. Only download links from this page will be allowed and again, relativ to your domain: $download_page = "/downloads.php"; // Your download page. 5. Whether unallowed download attempts will be logged or not: $log = TRUE; // Log access from disallowed referers or not. 6. The position of the log files. This time relative to where you store dl.php $log_file_all = "stats/allowed.log"; // The filename of the download log file. $log_file_dis = "stats/disallowed.log"; // The filename of the disallowed log file. Then create a directory "stats" under the directory where dl.php resides. Now you are ready to go! Example -------------------------------------------------- -----/ (webroot, your web pages reside here) /download.html (a list of your downloads) -----/downloads (the directory where your download files *.exe, *.zip, ... reside) -----/php (the directory where your php scripts reside. in this case at least dl.php) -----/php/stats (the directory where dl.php creates the log files. if this directoty doesn't exist, create it!) Use -------------------------------------------------- To use dl.php, link to your download files as follows: Download Licence -------------------------------------------------- Feel free to contribute and send me a e-mail to . DL is donated to the public domain. But please inform me if you make changes. Your are not allowed to integrate DL in any way into a commercial product. Friday, 8th of February 2002