简体   繁体   English

Flash注册表格

[英]Flash Registration Form

I need help with my flash registration form. 我需要我的Flash注册表格的帮助。 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. 我确保所有信息都是正确的,但是当我输入信息时,似乎并没有将其输入到mysql数据库中。 Here is the flash code: 这是Flash代码:

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: 这是PHP代码:

http://i.stack.imgur.com/cvvcO.png 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. 数据库信息没有错,因为我将php代码与html一起使用,但我无法使其与Flash一起使用。 My php file is called register.php and my flash file is called play.swf. 我的php文件称为register.php,而我的Flash文件称为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");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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