In a .htaccess file in the root of the domain:

PHP Code:
php_value auto_prepend_file /web/sites/user/scripts/start.php
php_value auto_append_file 
/web/sites/user/scripts/end.php 
First one will fire the php script at the beginning, or the 2nd one will do it at the end. You could use either or, or both.

Jimmy