tripwire
August 6th, 2003, 01:46 PM
I have a login page that checks the users login name and password against a mysql database. Now I'm having a simple problem that I can't seem to figure out. ONce the user has entered in a successful name and password I want to move to another frame. I'm doing this by using a print command from php that registers a CheckLog=1 variable. Now how would I go about checking this CheckLog variable to see if it equals 1.
Here is what I have so far on frame 2:
var myLoginVars = new LoadVars();
myButton.onRelease = function() {
if (!name.length) {
loginT = "Please Enter your name";
}
else if (!pass.length) {
loginT = "Please Enter your password";
}
else {
myLoginVars.name = name;
myLoginVars.pass = pass;
myLoginVars.sendAndLoad("login.php", myLoginVars, "POST");
myLoginVars.onLoad = checkLogin;
loginT = "Sending...";
}
}
function checkLogin() {
trace (this);
loginT = myLoginVars.retVal;
}
if (CheckLog ne "") {
gotoAndPlay (5);
} else {
gotoAndPlay (2);
}
Here is what I have so far on frame 2:
var myLoginVars = new LoadVars();
myButton.onRelease = function() {
if (!name.length) {
loginT = "Please Enter your name";
}
else if (!pass.length) {
loginT = "Please Enter your password";
}
else {
myLoginVars.name = name;
myLoginVars.pass = pass;
myLoginVars.sendAndLoad("login.php", myLoginVars, "POST");
myLoginVars.onLoad = checkLogin;
loginT = "Sending...";
}
}
function checkLogin() {
trace (this);
loginT = myLoginVars.retVal;
}
if (CheckLog ne "") {
gotoAndPlay (5);
} else {
gotoAndPlay (2);
}