简体   繁体   English

Flash / Php / MySQL注册表格

[英]Flash/Php/MySQL Registration Form

I've been to almost every forum possible with this question (including this one). 我去过几乎所有可能出现此问题的论坛(包括此问题)。 I almost got the answer to my question. 我几乎得到了我问题的答案。 The problem is no one seems to figure out my problem because everything looks right, and everything looks right to me too. 问题是似乎没人能解决我的问题,因为一切看起来都对,而且一切对我来说也都对。 Can someone please help me? 有人可以帮帮我吗? Here are my codes. 这是我的代码。

Flash Code: 闪存代码:

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

register_button.onRelease = function(){
var valid:Boolean = validateForm();
if (valid) {
    //gather information and put in loadvars object
    lvSend.username = username1.text;
    lvSend.password = password1.text;
    lvSend.email = email1.text;
    lvSend.sendAndLoad("register.php", lvReceive, "POST");
    gotoAndStop(1);
}
};
lvReceive.onLoad = function(success:Boolean) {
if (success) {
    username1.text = "";
    password1.text = "";
    email1.text = "";
}
}
function validateForm():Boolean {
if (username1.text == "" || password1.text == "" || email1.text == "") {
    return false;
}
return true;
}

Php Code: 邮递区号:

http://i.stack.imgur.com/RXPWb.png (Sorry its in link form) http://i.stack.imgur.com/RXPWb.png (抱歉,其链接形式)

Please favorite this or something until I get an answer because I've been everywhere and no one could help me. 请给我一个喜欢的东西,直到我得到答案为止,因为我到过无处不在,没有人可以帮助我。 :/ BTW I have been getting a few blank entries into my database but I don't know why. :/顺便说一句,我一直在数据库中输入一些空白条目,但是我不知道为什么。 Also, the lvReceive function doesn't seem to work, but when I add the username1.text = ""; 另外,lvReceive函数似乎不起作用,但是当我添加username1.text =“”; into the register_button function it seems to clear the text fields. 进入register_button函数,似乎清除了文本字段。 Please help me. 请帮我。 I left the database info on the php file cause I thought maybe the database I entered could be the problem, but I did use this php code with an html file and it worked fine. 我将数据库信息留在php文件中,因为我认为也许我输入的数据库可能是问题所在,但是我确实将此php代码与html文件一起使用,并且工作正常。 I will accept any answers. 我会接受任何答案。 Thanks in advance! 提前致谢! :D :D

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

You put the information in lvSend and not in lvReceive. 您将信息放入lvSend而不是lvReceive中。 Perhaps you should put the information in lvReceive: 也许您应该将信息放入lvReceive中:

    lvReceive.username = username1.text;
    lvReceive.password = password1.text;
    lvReceive.email = email1.text;
    lvSend.sendAndLoad("register.php", lvReceive, "POST");

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

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