Tuesday, July 23, 2013

Execute php script before every php script

  1. Make a .htaccess file in document root.
  2. Write the following code:
  3. php_value auto_prepend_file before_action.php
    php_value auto_append_file after_action.php
  4. create a file before_action.php in document root
  5. create a file after_action.php in document root
  6. or you can use full file path such: /var/www/html/site.com/before_action.php

http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

No comments:

Post a Comment