Jump to content

passing php variable


pietbez

Recommended Posts

Hi, can anybody please tell me how i can make "Arson" into a php variable

 


<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">

swfobject.embedSWF(
  "open-flash-chart.swf", "my_chart",
  "550", "400", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc-chart.php?crime=Arson"} );

</script>

Link to comment
https://forums.phpfreaks.com/topic/260295-passing-php-variable/
Share on other sites

Like this:

 

<?php
$var = "Arson"
?>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">

swfobject.embedSWF(
  "open-flash-chart.swf", "my_chart",
  "550", "400", "9.0.0", "expressInstall.swf",
  {"data-file":"ofc-chart.php?crime=<?php echo $var; ?>"} );

</script>

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.