1 Attachment(s)
[RESOLVED] strange!!! flash/php/mysql loging problem...
Hi,
I have a flash/php/mysql login and password reset form.flas passes the username and password to check if it exists PHP checkes with mysql DB returns the result.
here the flash button code which passes the variables.
Code:
on (release, keyPress "<Enter>") {
var sendData:LoadVars = new LoadVars();
var getData:LoadVars = new LoadVars();
theButton.onRelease = function() {
sendData.theText1 = theTextInput1.text;
sendData.theText2 = theTextInput2.text;
sendData.sendAndLoad("http://localhost/flashPost.php", getData, "POST");
check_mc._visible = true;
};
getData.onLoad = function() {
trace(this.posted)
if (this.posted == 1) {
check_mc._visible = false;
gotoAndPlay("change");
} else {
check_mc._visible = false;
login_error_mc._visible = true;
Selection.setFocus(theTextInput1);
}
};
}
and this the PHP Code
Code:
<?PHP
//First, we check to see that something was posted
//If you remember, our Flash variable was sendData.theText
//In PHP, it is just called theText
require_once("connection.php");
$username = $_POST['theText1'];
$password = $_POST['theText2'];
//check the database for existing users
$query = "SELECT *
FROM manager
WHERE user_name='".$username."' and passwd='".$password."' ";
$result = mysql_query($query) ;
//if user not match display agin login form
if (mysql_num_rows($result)!=1) {
session_unset(); // Unset session variables.
session_destroy(); // End Session we created earlier
echo "posted=0";
}else{
echo "posted=1";
}
?>
i php mysql runnig in localhost and code works fine..BUT only for one entry in the table..but there are 3 entries..
table name - manager
nameez - 123 (only for this it works)
mohan - 234
faseel - 345
table details and source files attached..
and also when i test the movies i have to click it several times to get the result..
any flash masters pls help me