I have been using php to insert parts of my pages that are consistent from page to page, such as the footer, and masthead,using code such as this:
<?php include($DOCUMENT_ROOT . "/x_includes/disclaim.php"); ?>
While looking for what an error page (401, 403, 404, etc.) should look like, I found a page that among other things has some php above the doctype and below the </html> tag, that works with some code in the middle of the page to hide an email address. I know I can remove this code, and I likely will remove it, but I want to know why it kills my php inserts. The page that is currently messed up is http://www.brighterdaycharities.org/err/401.php which only has one insert near the bottom of the page.
When you view the source at the page, you do not see the php at the top and bottom, so here it is:
<?php //Ûž//text{encoding:utf-8;bom:no;linebreaks:unix;text:4 spaces/tab;}// initialize..
do_init();
include ('mail-mash.php');
$email_addy = mail_mash('webmaster@roberson-family.com');echo '<?xml version="1.0" encoding="utf-8"?>
that was at the very top of the page, and here is what is at the very bottom of the page:
';
// init
function do_init() {
global $corz_root, $doc_content;
if (stristr(@$_SERVER['HTTP_ACCEPT'],'application/xhtml+xml')) {
$doc_content = 'application/xhtml+xml';
} else {
// read: "Internet Explorer"
$doc_content = 'text/html';
}
$corz_root = $_SERVER['DOCUMENT_ROOT'];
}
?>
// init
function do_init() {
global $corz_root, $doc_content;
if (stristr(@$_SERVER['HTTP_ACCEPT'],'application/xhtml+xml')) {
$doc_content = 'application/xhtml+xml';
} else {
// read: "Internet Explorer"
$doc_content = 'text/html';
}
$corz_root = $_SERVER['DOCUMENT_ROOT'];
}
?>
I suppose this will be very simple after someone explains it to this old man.
