eelixduppy - 1:08 pm on Mar 14, 2012 (gmt 0)
Hi and welcome to WebmasterWorld. This will not work because $_SERVER['SCRIPT_FILENAME'] does not contain what you think it does. It will contain the absolute path to the server.php script.
See here: [php.net...]
To amend this, it would probably make sense to include two files in each php page, one at the top and one at the bottom. In each, you open and close the output buffer respectively.