Passing variable to PHP from JS
<p>I know its REALLY simple, but I'm a newbie.  I want to pass a variable from a PHP query via JS (for open-flash-chart) to the data file which is PHP.</p>

<p>This is my JS inside my PHP file.  I'm pretty certian my issue is with the JS part since I've never used it before.  </p>

<pre><code>&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;

var player = "&lt;? echo $player1 ?&gt;";

swfobject.embedSWF(
"open-flash-chart.swf", "my_chart", "900", "350", "9.0.0", "expressInstall.swf", {"data-file":"data2.php"} );  

&lt;/script&gt;
</code></pre>

<p>I am trying to pass the $player variable to the graph data file which is this ( data2.php)</p>

<pre><code>&lt;?php
include("include/session.php");

include 'open-flash-chart/php-ofc-library/open-flash-chart.php';

if  (isset($_GET['player'])) {
$player = $_GET['player']; }


$sql = "SELECT pos FROM nflscore where username = '$player'";
</code></pre>
