I am writing the following html code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
function detectBrowser(){
if(navigator.appName === "Microsoft Internet Explorer"){
window.open("redirect.html", "_parent");
}
}
</script>
</head>
<body onload="detectBrowser()">
<div class="mainBody">
<?php
echo "test";
?>
</div>
</body>
</html>
But the php block doesn't display test for me. It looks like it is not parsed and I can see the php code in the webpage's source. Any one can tell the problem?
Thank you
.php? Is your server running PHP?.php. It will still be HTML! But you need to be on a web server that is configured with PHP..phpextension or else the webserver don't know that the file should be parsed as php. If you would like to use another extension like.htmlthis can be done by using aAddTypedirective in a.htaccessfile. Make sure you also show the extension of all files if you are using windows. The file should also be run through a installed server, do you have one?