Well it pretty much depends on your needs!
Will javascript alter that variable? if not, the best way to transfer data between php pages are sessions! there are other options such as cookies, get vars, post vars etc. but users may change them putting your script in an uncomfortable position of dealing with wrong information if users do!
Using sessions your first page would simply look like this:
<?php session_start(); $_SESSION['player'] = $player; ?>
<!-- [...] -->
<script type="text/javascript">
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "900", "350", "9.0.0", "expressInstall.swf", {"data-file":"data.php"} );
</script>
<!-- [...] -->
session_start has to be put at the very beginning of your php file, no headers should be sent before that function!
Well, your data file would then just become something like this:
<?php session_start();
/* ...your includes and the rest... */
$sql = "SELECT pos FROM nflscore where username = '{$_SESSION['player']}'";
Using cookies instead is quite the same, you just don't have to start the session at the beginning of your script (but if its a game you should rely on them already)! whats best though, you can access the cookie afterwards in your javascript as well!
so that's what your first page should look like :
<?php setcookie('player', $player) // somewhere in the script ?>
<!-- [...] -->
<script type="text/javascript">
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "900", "350", "9.0.0", "expressInstall.swf", {"data-file":"data.php"} );
</script>
<!-- [...] -->
an your data page also becomes :
$sql = "SELECT pos FROM nflscore where username = '{$_COOKIE['player']}'";
The third easy option is to just drop the information where it should be right from the beginning ;) so no sessions, no cookies but just plain get variables!
first file :
<!-- [...] -->
<script type="text/javascript">
swfobject.embedSWF("open-flash-chart.swf", "my_chart", "900", "350", "9.0.0", "expressInstall.swf",
{"data-file":"data.php?player=<?php echo $player ?>"} );
</script>
<!-- [...] -->
second file :
$sql = "SELECT pos FROM nflscore where username = '{$_GET['player']}'";
Things become different though if your javascript needs to change the variable's content