<ï¼
if not IsEmpty(Session(“custâid“)) and Len(Session(“custâid“))>0 thenxml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /??
‘ ç¨æ·ç»å½åæå主页.
ã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“) 3Ⲡand â²custâpwd=â²“ï¼ request(â³pwdâ³) 3ⲓ
‘ è¿æ¥æ°æ®åº,å
¶ä¸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 3Ⲡwhere cust_id = “ï¼ Session(“custâid“) 3”)
‘ æ´æ°æåç»å½æ¶é´,å¯é.
ãããã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]