Rather than having to call / include a file you need on every single page, you can have them automatically prepended (top of file) or appended (bottom of file) automatically through your .htaccess file.
php_value auto_prepend_file "/real/path/to/file/functions.php"
php_value auto_append_file "/real/path/to/file/footer.php"
nice – you can use also the php.ini for this
but is it safe???
I’m completely new to this stuff… for that one tutorial you did for Kailin Yung, could you use this to get those curly things to appear on the h2 tags? and if so/not, how would you go about doing that?
I’m quite new to this stuff. In the tutorial where you made a new theme for Kailin Yung, could this be used to get those curly things onto all the h2 tags? haha i’m trying my hardst to find out how to do that and just cant figure it out.
Hey Chris, this is a very useful tool, so thanks. Now, is there any way to selectively append and prepend files? I have pages where I need no footer or header. Can I include a few lines in my htaccess to negate the action for certain files? Because my htaccess file and all of my files are in the head directory, switching file locations doesn’t seem like it’d work, and I don’t know enough to do anything else. Thanks for the snippet!
I’ve used this on my website http://www.latte-internet.com The htaccess things are pretty useful.
And then some other poor guy, charged with maintaning your code after you leave, will loose his mind trying to understand why he has some alien includes interferring with his files.
Or somebody comes and says: “Hey! Apache is history! Lets move to ngingx / lighttpd + php-fpm! Oh… wait. How come your code has to be refactored for this? This should be a simple matter of writing new configuration file!”
Or you can manage PHP matters with PHP methods, and, for example, use an amazing thing called “Class Autoloading” — something that all modern PHP frameworks utilize: http://php.net/manual/en/language.oop5.autoload.php