carmenMiranda
Programmer
I have a problem when trying pass a variable (entered into an input textfield) from Flash to PHP. When the button is hit to activate the LoadVars object, the PHP script returns the error message:
Notice: Undefined index: years in /Users/phil/Sites/phpflash/campaign/calculation.php on line 2
Here's the Flash script:
var path:String = "
var dataOut:LoadVars = new LoadVars();
myBtn.onRelease = function() {
dataOut.years = years_txt.text;
dataOut.send (path + "calculation.php", "_blank");
//trace(years_txt.text);
};
And here's the PHP script (called 'calculation.php'):
<?php
$calculation = $_POST['years']*7;
echo $calculation;
?>
The trace function shows me that the value entered by the user is recognised and I've done all the usual checks (ie: checking the path names and instance names etc are all correct), but I'm still getting the Undefined index error.
Can anyone help?
Notice: Undefined index: years in /Users/phil/Sites/phpflash/campaign/calculation.php on line 2
Here's the Flash script:
var path:String = "
var dataOut:LoadVars = new LoadVars();
myBtn.onRelease = function() {
dataOut.years = years_txt.text;
dataOut.send (path + "calculation.php", "_blank");
//trace(years_txt.text);
};
And here's the PHP script (called 'calculation.php'):
<?php
$calculation = $_POST['years']*7;
echo $calculation;
?>
The trace function shows me that the value entered by the user is recognised and I've done all the usual checks (ie: checking the path names and instance names etc are all correct), but I'm still getting the Undefined index error.
Can anyone help?