I have important variables that I want to include in all of my php files in the project and I want that done automatically. How do I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A good way is to use UrlRewriting.
You redirect each request on
index.phpwith get parameters, and this file will load the appropriate content. Then you’ll be able to centralize some setting. For example, you just have to put your include in the fileindex.php, and every page will have it.