If your script is inline on a PHP page:
PHP Code:
myChart.setDataURL("<?php echo $mytempname; ?>");
Even if it's not, you would use the same syntax, but let's say your script is called chart.js and you use a tag like:
HTML Code:
<script type="text/javascript" src="chart.js"></script>
to get it onto your page. Then you need to rename it to chart.php and call it like so to your page:
HTML Code:
<script type="text/javascript" src="chart.php"></script>
AND you need to put this as the very first line in it:
PHP Code:
<?php header('Content-type: text/javascript'); ?>
Bookmarks