Debt Consolidation - Anime Episodes - Web Hosting - Myspace Layouts - Find jobs

PDA

View Full Version : Run some PHP code before every request or PHP file?


karabas
Jan 23rd 2009, 10:55 am
Is there some way I can configure web server to execute some PHP code before actual PHP page is interpreted or force include PHP code into every PHP file of my webapp similar to force include option in Visual C++ (http://stackoverflow.com/questions/320723/visual-c-force-includes-option)?

EricBruggema
Jan 23rd 2009, 1:36 pm
try using htaccess! :)

bbrez1
Jan 23rd 2009, 1:50 pm
karabas, why not just include a file on top of the file?

karabas
Jan 23rd 2009, 3:03 pm
I want to run the code on top of other CMS applications like Wordpress etc and really would like to avoid messing with their code.

For the same reason I would like to avoid using .htaccess

joebert
Jan 24th 2009, 3:40 am
http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

bbrez1
Jan 24th 2009, 3:53 am
http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

Thank you joebert, I was also very interested in this :) Rep added