登录的实现

      ASP 2005-6-21 8:32: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/login.asp", "", "POST");
        gotoAndPlay(2);
    }
}
第二十帧:
if (msg == "ok") {
    play();
} else {
    gotoAndStop(20);
}
login.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
if password=rs("password") then
response.write"msg=ok"
else
response.write"msg=fail"
end if

'rs.addnew
'rs("username") = username
'rs("password")=password
'rs.update
'set rs = nothing
'set conn = nothing
userexist=1
end if
rs.MoveNext
wend
%>


标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

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