hello,
wondering how you might go about triggering PHP scripts from an apache configuration file, for certain events...
for instance, how might i trigger a script whenever a file was accessed within a given directory. and, would it be possible to know which file was accessed?
if the above is possible, could you also trigger different scripts for when a "file download begins" and when a "file download finishes"?
thanks.
Seems you want mod_rewrite. Lets say you have /download/ directory, then you put this in /download/.htaccess
RewriteEngine on RewriteRule ^.*$ handler.php
handler.php will be the script that will be triggered for all requests to /download/ directory, you can find out the real request from $_SERVER['REQUEST_URI'], do whatever magic you need to do. But don't forget that you will have to output the file yourself, in handler.php, including the right headers.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php