what format would I use in PHP for a login?
here is the AS in the flash
import mx.controls.*;
var status_lbl:Label;
var username_lbl:Label;
var username_ti:TextInput;
var password_lbl:Label;
var password_ti:TextInput;
// change the colors of the labels
this.username_lbl.setStyle("color", 0xFFFFFF);
this.password_lbl.setStyle("color", 0xFFFFFF);
submit_btn.clickHandler = function() {
checkForm();
};
var formListener:Object = new Object();
formListener.enter = function(evt) {
checkForm();
};
username_ti.addEventListener("enter", formListener);
password_ti.addEventListener("enter", formListener);
Selection.setFocus(username_ti);
function checkForm() {
if (username_ti.text.length == 0) {
status_lbl.text = "<font color=\"#FF0000\">Please enter user name.</font>";
Selection.setFocus(username_ti);
return false;
}
if (password_ti.text.length == 0) {
status_lbl.text = "<font color=\"#FF0000\">Please enter password.</font>";
Selection.setFocus(password_ti);
return false;
}
// clear the status_lbl Label instance
status_lbl.text = "";
var result_lv:LoadVars = new LoadVars();
var login_lv:LoadVars = new LoadVars();
login_lv.username = username_ti.text;
login_lv.password = password_ti.text;
login_lv.sendAndLoad("http://www.flash-mx.com/mm/login.cfm", result_lv, "POST");
// When the results are received from the server...
result_lv.onLoad = function(success:Boolean) {
if (success) {
if (this.isValidLogin == 1) {
status_lbl.text = "<font color=\"#009900\"><b>login successful.</b></font>";
} else {
status_lbl.text = "<font color=\"#FF0000\">invalid user name / password.</font>";
Selection.setFocus(username_ti);
Selection.setSelection(0, username_ti.text.length);
}
} else {
status_lbl.text = "<b>Unable to connect to login URL</b>";
username_ti.enabled = false;
password_ti.enabled = false;
submit_btn.enabled = false;
}
};
return true;
}
of course this is the Flash MX 2004 example login…
but how would I set up the PHP for this?
How would I set up mySQL Database?
please help…