Insert code from a file and parse it?
Posted: Thu Jul 24, 2008 4:43 pm
I'm trying to insert a block of code onto every page in a site, and I'd like the code to be parsed. In other words, I'm using the same chunk of PHP code of every page.
Here's how I'm currently inserting the code:
$header = file_get_contents("/home/path/to/code.php");
echo $header;
This successfully inserts the file as text, but it doesn't process the PHP.
Is there a way to insert a block of PHP code from a file onto every page?
Thanks for any help.
Here's how I'm currently inserting the code:
$header = file_get_contents("/home/path/to/code.php");
echo $header;
This successfully inserts the file as text, but it doesn't process the PHP.
Is there a way to insert a block of PHP code from a file onto every page?
Thanks for any help.