To insert php code in a html file, just use the following method:

1. in your html file use
html Code:
<script src=”/script.php” type=”text/javascript”></script>

2. then in the php file, make sure you use
php Code:
<?phpheader(”content-type: application/x-javascript”);?>