Jump to content

Transfering value from PHP to javascript


jokerbla

Recommended Posts

<script type="text/javascript">
<--
<?php 
echo ("average = $average;");
?>
// -->

document.write(average);
document.write("average");
</script>

 

I want to transfer the $average from PHP to average from javascript, but this isn't working. Neither the value of average, nor the string "average" shows up at the end. What am I doing wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.