0

In PHP, do I literally have to include a specific file in all scripts to ensure that it is called before all others? I intend to define some constants and all scripts are to expect/pretend that these constants were already defined without any need to double check.

How can I ensure that a specific script is called when a visitor visits a system?

Another question. Are constants created with the define() method available to all users that are visiting a system? Does this special script that I intend to create need to be invoked JUST ONCE when the very first user visits the system? Or do the constants need to be recreated whenever a new user visits the system?

pnuts
  • 58,317
  • 11
  • 87
  • 139
  • 1
    `define()` must be executed every page load – Erbureth Jan 05 '15 at 16:17
  • If define() has to be executed at every page_load than what kind of constant is it! It must be redefined every time??? – Ramon Saguna Jan 06 '15 at 09:40
  • http://stackoverflow.com/questions/14884439/automatically-load-a-config-php-file-for-all-pages-before-anything-else that covers your question exactly. auto_prepend_file I learn something new every day! It's set either in apache htacess or php.ini depending on if you use php cgi or not. – Lizardx Nov 05 '15 at 21:36

0 Answers0