Hi
I'd like to call an external js file as a php file, something like:
<?php
<html><head>
<script language=”JavaScript” type=”text/javascript” src=”js.php”></script>
</head>
<body>
</body>
</html>
?>
I've tried making the js.php file like the following but I get a syntax error:
<?
Header(”content-type: application/x-javascript”);
$testvar=”Hat”;
echo “document.write(\”Item: <b>” . $testvar . “</b>\”)”;
?>
The error I get is:
<br />
<b>Parse error</b>: syntax error, unexpected ':' in <b>/path/to/js/js.php</b> on line <b>2</b><br />
Any idea why it might be triggering this error?
Thanks