All php files should open with:
<?php
Then, when you want to go back into php from HTML you can just use <? ?>. But, to declare what language you're in you MUST start the first php section with <?php.
Example
<?php
include ("somefile.php")
?>
<html>
<head>
</head>
<body>
<? somefunctioninsomefile(); ?>
</body>
</html>
OR
<html>
<head>
</head>
<body>
Test: <?php echo($_SERVER['HTTP_REFERER']); ?>
</body>
</html>