I am trying to make a page that returns a file if the page is being requested by a user, and returns a api response if requested by code. It works fine but google chrome (and ie) render the user page as if it was:
<head></head>
<body><title>BLAH</title>
<h1>Bloo bloo blah</h1></body>
Even though view source returns:
<head><title>BLAH</title></head>
<body><h1>Bloo bloo blah</h1></body>
but when I go to the page that is being included, it displays improperly.
PHP code:
<?php
if ($_GET['mode']) {
echo 'server response';
}
else {
include_once('main.php');
}
?>
main.php code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>BLAH</title></head>
<body><h1>Bloo bloo blah</h1></body>
</html>
Any help would be appreciated. I am using IIS 6.1 with PHP 5.3.5 running on a Windows 7 computer.
Bloo bloo blah
` – comp500 Aug 09 '11 at 11:09