佳木斯湛栽影视文化发展公司

主頁(yè) > 知識(shí)庫(kù) > 如何最大限度地實(shí)現(xiàn)安全登錄功能?

如何最大限度地實(shí)現(xiàn)安全登錄功能?

熱門(mén)標(biāo)簽:美圖手機(jī) 網(wǎng)站文章發(fā)布 智能手機(jī) 服務(wù)器配置 鐵路電話系統(tǒng) 呼叫中心市場(chǎng)需求 銀行業(yè)務(wù) 檢查注冊(cè)表項(xiàng)


if not IsEmpty(Session(
"cust—id")) and Len(Session("cust—id"))>0 then

' 用戶登錄后指向主頁(yè).
 Response.Redirect("navigation/dashbrd.asp")

 ' 在此添入真正的主頁(yè)URL.

end if

bLogin = False
  

' 設(shè)置標(biāo)志.
bError = False
if IsEmpty(Request(
"uid")) or Len(Request("uid")) = 0 or IsEmpty(Request("pwd")) or Len(Request("pwd")) = 0 then  

' 檢查空字符.
  bLogin = True
else

 

----------------------------------------------------------------------------------------------------------------
' 檢驗(yàn)數(shù)據(jù)庫(kù)保存密碼表中是否有該用戶.
"select from customer WHERE cust—id=′ " request("uid") "′ and ′cust—pwd=′" request(″pwd″) ""
' 連接數(shù)據(jù)庫(kù),其中request(″uid″)request(″pwd″) 為本頁(yè)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變量中記錄有用的信息.此項(xiàng)為數(shù)據(jù)庫(kù)中用戶名.
    Session("cust—pwd") = rsCust.Fields("cust—pwd")

' 此項(xiàng)為數(shù)據(jù)庫(kù)中用戶密碼.
    Session("power") = rsCust.Fields("power")

        ' 此項(xiàng)為數(shù)據(jù)庫(kù)中用戶權(quán)限,可選.

    ' rsCust.ActiveConnection.Execute ("update customer set cust—login = ′ " Now "′ where cust_id = " Session("cust—id") "")

' 更新最后登錄時(shí)間,可選.

    Response.Redirect("navigation/dashbrd.asp")

        ' 真正主頁(yè)URL.
  Else
    ′UID and password not found
    bError = True bLogin = True
  end if

  rsCust.Close
   ' 關(guān)閉記錄.
   mycn—login.Close
  set mycn—login=Nothing
 end if
>

 

----------------------------------------------------------------------------------------------------------------

' 登錄頁(yè)面.

form name="login" action="default.asp" method="post" target="—top">

' html中加入FORM,并設(shè)為自發(fā)送頁(yè).action后面要接本頁(yè)的URL,這樣,即使用戶登錄錯(cuò)誤,在本頁(yè)即可獲得提示,而無(wú)須再返回前一頁(yè)登錄.

input name="uid" size="10"maxlength="10" style="HEIGHT: 21px; WIDTH: 101px">

input name="pwd"type="password" size="10" maxlength="10">

[1]

標(biāo)簽:滄州 新疆 紅河 上海 沈陽(yáng) 樂(lè)山 長(zhǎng)治 河南

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何最大限度地實(shí)現(xiàn)安全登錄功能?》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    荔波县| 东平县| 濉溪县| 福建省| 陵水| 五家渠市| 昌图县| 施甸县| 宜兰县| 东山县| 巴林右旗| 滦平县| 东港市| 育儿| 潼关县| 镇平县| 沙坪坝区| 三原县| 图们市| 吐鲁番市| 青岛市| 正安县| 上林县| 兴隆县| 朝阳市| 夹江县| 子长县| 赤水市| 澄迈县| 绍兴县| 曲周县| 达拉特旗| 东丽区| 浦北县| 澳门| 双鸭山市| 五家渠市| 渝中区| 黑山县| 云龙县| 西吉县|