注册的实现

      ASP 2005-6-21 8:35:00
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
%>
标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}
深度XP 雨林木风XP WinXP下载 世界之窗 深度系统 雨林木风 Ghost ghost系统盘 XP下载