Run PHP script on all pages
php
Solution
Having a single file act as a controller that loads all your other files (perhaps index.php) is a common way, but if that's not possible, I'd suggest prepend files as mentioned by Matt Browne. (Apache dependent.) I actually did an append to force a footer on a site that was all static pages. I had to do it in php.ini, not .htaccess.
# Append file to bottom of page
auto_append_file = '/home/mycustomer/public_html/sub_footer.php'
So, yours could be
# Prepend file to top of page
auto_prepend_file = '/yourpath/pre_header.php'
Problem
I am working on a project and I need to run the same php script on every page or before loading the page. I want the actual `<? /*code here*/?>` on every page on the server. Is there any way to pull of something like this?