MyBB Community Forums

Full Version: Run PHP File every time any page loads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, I have this PHP file in my root directory that I want to load anytime someone accesses any page of my site... So how would I go about putting that in the header/footer to run that PHP file... When i put all the code from the file it gives an error... So I just need to run the file..

Ive tried task manager, but the file has to be in the root directory, not inc/tasks and that doesn't work

This will help me out a lot, thanks to anyone who can assist me.

-Cheers
You can use php's include function for the file to run on page load. http://php.net/manual/en/function.include.php
Im not wanting to include it for reference, Im wanting it to run... Right now I have it at the very bottom of my index.php page... and if it is above anything it gives an error... I tried putting it in my footer (The php code)... error as well... I need some way to put it in the header or footer to run the PHP file Toungue

-Cheers