How to check flash content with php
Posted: Tue Feb 24, 2009 11:51 pm
i have trouble with following code please help me....
this is the flash script file
===================
this is the flash script file
===================
Code: Select all
var dataOut:LoadVars = new LoadVars();
var dataIn:LoadVars = new LoadVars();
dataIn.onLoad = function(res) {
//trace("valid :"+valid);
if (this.res=="1") {
trace("correct :"+this.res);
trace(" user name"+username.text);
trace(" pass wo"+password.text);
} else {
trace("incorrect"+this.res);
}
}
// the function that will be called by the Enter button
function checkUser():Void {
dataOut.username = username.text;
dataOut.password = password.text;
dataOut.sendAndLoad("check.php",dataIn,"POST");
}
login_btn.onPress =function() {
checkUser();
}
check.php
=======
[code=php ]
<?php
if ($_POST['username']=='Fred' && $_POST['password']=='0001') {
echo '&res=1&';
}
else
echo '&res=0&';
?>
[ /code]
while im giving right data for username and password it always goes to else block only that results error to my output
please help me...........