%
response.contenttype="text/html;charset=utf-8"
session("cid") = ""
session("cname") = ""
if dpost="ok" then
if code <> session("code") then
showmsg "验证码错误","login.asp"
end if
set rs = conn.execute("select * from cuser where logname = '"&username&"' and logpass = '"&md5(password)&"'")
if rs.eof then
showmsg "用户名密码错误","login.asp"
else
session("cid") = rs("id")
session("cname") = rs("logname")
session("qx") = rs("qx")
response.Cookies("logname") = rs("logname")
response.Cookies("logpass") = rs("logpass")
showmsg 0,"index.asp"
end if
end if
%>