The results of PHP processing instructions don't get displayed in the browser or HTML editor if PHP didn't process the script first. Instead of using the PHP print and echo functions to send HTML to the output, you should embed processing instructions in your HTML template. That way the HTML layout gets displayed even if PHP didn't process the file first. So, instead of this:
PHP Code:
echo "<html>"
. "<head>"
. "<title>" . $page_title . "</title>"
. "</head>"
. "<body>"
. $page_content
. "</body>"
. "</html>";
do this:
PHP Code:
<html>
<head>
<title><?=$page_title; ?></title>
</head>
<body>
<?=$page_content; ?>
</body>
</html>