简体   繁体   中英

Flash Registration Form

I need help with my flash registration form. I made sure all my information is correct, but when I enter the information, it doesn't seem to enter it into the mysql database. Here is the flash code:

var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();

register_btn.onRelease = function() {
var valid:Boolean = validateForm();

if(valid){
//gather information and put in loadvars object
lvSend.username = username.tInput.text;
lvSend.password = password.tInput.text;
lvSend.email = email.tInput.text;

//send information php script for insertion into database
lvSend.sendAndLoad("register.php", "POST");
}
};
function validateForm():Boolean{
if(username.tInput.text == "" || password.tInput.text == "" || email.tInput.text == ""){
    return false;       
}
    return true;
}
function clearTextFields():Void{
username.tInput.text = "";
password.tInput.text = "";
email.tInput.text = "";
}

Here is the Php Code:

http://i.stack.imgur.com/cvvcO.png

Sorry that my code is in picture form. That was the best way I could make it readable by you guys.My problem is that all the information in both codes seem correct. All my text fields are called username, password, and email, same goes for the database columns. The database info isn't wrong because I used the php code with html, I just can't get it to work with flash. My php file is called register.php and my flash file is called play.swf. Thanks for your help!

try:

lvReceive.onLoad = function(success:Boolean) {
if (success) {
    trace("ok");
}
else {
    trace("error");
    }

lvSend.sendAndLoad("register.php", lvReceive, "POST");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM