国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 編程設計 > 正文

如何最大限度地實現安全登錄功能?

2020-06-19 13:50:30
字體:
來源:轉載
供稿:網友

<
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]

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乐清市| 疏勒县| 尉氏县| 青河县| 泰来县| 含山县| 石台县| 高尔夫| 奉化市| 苏尼特左旗| 民县| 驻马店市| 台湾省| 五原县| 高阳县| 五大连池市| 兴安县| 泰兴市| 柳林县| 中超| 阿坝县| 甘南县| 丹江口市| 柳河县| 腾冲县| 原平市| 五华县| 甘孜县| 比如县| 彩票| 泾川县| 奇台县| 夏河县| 山丹县| 德钦县| 湖北省| 平顶山市| 朝阳区| 泽州县| 通许县| 东兰县|