Question
LoadVars and PHP
I'm trying to use LoadVars to bring a user ID into Flash from
a PHP page and then put the user ID into a dynamic text box. The
user ID is created from 2 separate numbers that are received via a
form. The problem is that I can't get Flash to load the variable.
If I hardcode a number in then everything works fine, but it Flash
doesn't seem to like dynamically created variables.
php code that works:
<?php echo "&qID=54564656&"; ?>
php code that doesn't work. With this one the Flash text field is blank. It doesn't even read "undefined".
<?php
$subDB = substr($_POST["quizDB"], 4);
$qID = $subDB.$_POST["quizNum"];
echo "&qID=".$qID."&";
?>
Flash code:
fromQuiz = new LoadVars();
fromQuiz.load("test.php");
fromQuiz.onLoad = function()
{
ID_txt.text = fromQuiz.qID;
}
Thanks
php code that works:
<?php echo "&qID=54564656&"; ?>
php code that doesn't work. With this one the Flash text field is blank. It doesn't even read "undefined".
<?php
$subDB = substr($_POST["quizDB"], 4);
$qID = $subDB.$_POST["quizNum"];
echo "&qID=".$qID."&";
?>
Flash code:
fromQuiz = new LoadVars();
fromQuiz.load("test.php");
fromQuiz.onLoad = function()
{
ID_txt.text = fromQuiz.qID;
}
Thanks
