<%
if not IsEmpty(Session("cust—id")) and Len(Session("cust—id"))>0 then
' 用户登录后指向主页.
Response.Redirect("navigation/dashbrd.asp")
' 在此添入真正的主页URL.
end if
bLogin = False
' 设置标志.
bError = False
if IsEmpty(Request("uid")) or Len(Request("uid")) = 0 or IsEmpty(Request("pwd")) or Len(Request("pwd")) = 0 then
' 检查空字符.
bLogin = True
else
----------------------------------------------------------------------------------------------------------------
' 检验数据库保存密码表中是否有该用户.
"select * from customer WHERE cust—id=′ " & request("uid") &"′ and ′cust—pwd=′"& request(″pwd″) &"′"
' 连接数据库,其中request(″uid″)和request(″pwd″) 为本页html中表单中的用户名和密码的text.
gbFound = False
----------------------------------------------------------------------------------------------------------------
if not rsCust.BOF and not rsCust.EOF then
gbFound = True
end if
if gbFound then
Session("cust—id") = rsCust.Fields("cust—id")
' 在session变量中记录有用的信息.此项为数据库中用户名.
Session("cust—pwd") = rsCust.Fields("cust—pwd")
' 此项为数据库中用户密码.
Session("power") = rsCust.Fields("power")
' 此项为数据库中用户权限,可选.
' rsCust.ActiveConnection.Execute ("update customer set cust—login = ′ "& Now &"′ where cust_id = "& Session("cust—id") &"")
' 更新最后登录时间,可选.
Response.Redirect("navigation/dashbrd.asp")
' 真正主页URL.
Else
′UID and password not found
bError = True bLogin = True
end if
rsCust.Close
' 关闭记录.
mycn—login.Close
set mycn—login=Nothing
end if
%>
----------------------------------------------------------------------------------------------------------------
' 登录页面.
<form name="login" action="default.asp" method="post" target="—top">
' 在html中加入FORM,并设为自发送页.action后面要接本页的URL,这样,即使用户登录错误,在本页即可获得提示,而无须再返回前一页登录.
input name="uid" size="10"maxlength="10" style="HEIGHT: 21px; WIDTH: 101px">
<input name="pwd"type="password" size="10" maxlength="10">
[1]
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 黑鸭子.2005-《发烧DSD》柏菲[WAV分轨]
- 群星.1990-电影看板·人间道【宝丽金】【WAV+CUE】
- 周殷廷.2024-TO.WHOM.IT.MAY.CONCERN【环球】【FLAC分轨】
- 草蜢.1997-三人世界精选17首【宝丽金】【WAV+CUE】
- 【古琴音乐】管平湖《广陵散》2004[FLAC+CUE]
- 【中国民乐】《少数民族器乐·苗岭的早晨》2004[WAV+CUE]
- 【中国音乐】盛中国《新疆之春》2004[FLAC+CUE]
- 群星《音你而来 第8期》[320K/MP3][44.64MB]
- 群星《音你而来 第8期》[FLAC/分轨][121.21MB]
- 群星《十二女声Ⅲ》[WAV/CUE/分轨][626.4MB]
- 陈百强.1993-离不开...纪念歌集2CD【华纳】【WAV+CUE】
- 于台烟.2003-爱自己【乾坤唱片】【WAV+CUE】
- 群星.2024-我们永远是我们电影原声带【乐禾发文化】【FLAC分轨】
- 【中国民乐】张维良《秋江夜泊》2004[FLAC+CUE]
- 明达年度发烧碟MasterSuperiorAudiophile2011[DSF]