2005/06/21 | 注册的实现
类别(ASP) | 评论(0) | 阅读(267) | 发表于 08:35
FLASH中:
第一帧按钮:
on (release) {
    if (username == "" or username == "请输入姓名" or username == undefined) {
        username = "请输入姓名";
    } else if (password == "" or password == "请输入密码" or password == undefined) {
        password = "请输入密码";
    } else {
        loadVariables("user_login_and_registe/registe.asp", "", "POST");
        gotoAndPlay(21);
    }
}
第三十七帧:
if (msg == "ok") {
    play();
} else {
    gotoAndStop(40);
}
registe.asp的内容:
<%
userexist=0
username=Request.form("username")
password=Request.Form("password")
set conn = server.createobject("adodb.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("userinfo.mdb")
set rs = server.createobject("adodb.recordset")
rs.open "userinfotable",conn,1,3

'sql = "select username from userinfotable order by id desc"
'SQL语句,从数据表邮件列表中读出所有数据,并根据ID进行反向排列。
'rs.Open sql,conn,1,3
'rs.AddNew
'打开从库中读出的记录集。
'response.Write "list="
'输出"list="这几个字符
while not rs.eof
'While 循环语句,这里是条件,当记录集没有空时,执行后边的语句。

if username=rs("username")then
response.write"msg=fail"
userexist=1
end if
rs.MoveNext
wend
if userexist=0 then
rs.addnew
rs("username") = username
rs("password")=password
rs.update
set rs = nothing
set conn = nothing
response.write"msg=ok"
end if
%>
0

评论Comments

日志分类
首页[186]
Flash[84]
FMS[41]
AIR[2]
ASP[11]
作品区[12]
其他[36]