I am in a situation where I have quite a few files in my project but wish to add just a handful of things beforehand.
I can technically add requires to each file at the beginning but this would be a long process, and I would need to point them to different level directories for each one.
Is there a method to force PHP to load a file along (before) each execution of another file?
Prepend file so I can include HTTP headers?
Started by FireGator, Nov 25 2010 08:44 AM
2 replies to this topic
#1
Posted 25 November 2010 - 08:44 AM
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]
>++++++++[<++++>-] <.>+++++++++++
>++++++++[<++++>-] <.>+++++++++++
|
|
|
#2
Posted 25 November 2010 - 08:49 AM
There is a method right of the bat for you that the PHP engine provides, It is the option auto_prepend_file. It can be applied to vhosts, php.ini or .htaccess level configurations:
format: auto_prepend_file <path> ex: php_value auto_prepend_file $HOME/public_html/prependheaders.php
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 25 November 2010 - 08:52 AM
Nullw0rm said:
There is a method right of the bat for you that the PHP engine provides, It is the option auto_prepend_file. It can be applied to vhosts, php.ini or .htaccess level configurations:
format: auto_prepend_file <path> ex: php_value auto_prepend_file $HOME/public_html/appendheaders.php
Ha! This looks exactly right, thanks. It was more for a security thing, it was the best way.
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]
>++++++++[<++++>-] <.>+++++++++++
>++++++++[<++++>-] <.>+++++++++++


Sign In
Create Account


Back to top









