Forum Moderators: open
I have a php-file which echos xhtml and javascript. Its a very very simple page. If i remove the php OR javascript it works perfectly. But when they're combined I keep getting the blank page 3 out of 4 times.
ANYONE?
<?
echo("
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!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\" xml:lang=\"en\" lang=\"en\">
<head>
<title>Foobar</title>
<script type=\"text/javascript\">alert(\"Hello!\");</script>
</head>
<body>Hello!</body>
</html>
");
?>
An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol. Here is an example of an XHTML document. In this example, the XML declaration is included.