asp登入儲存資料到cookie

來源:互聯網
上載者:User

這裡是根據使用者的選擇是否允許把使用者名稱密碼儲存到cookie裡面哦,我們特別注意那代碼藍色的代碼哦。

set rs=server.createobject("adodb.recordset")
 exec="select * from yrwl_tb_admin where yhm='"&yhm&"'"
 rs.open exec,conn,1,1
 if not rs.eof then
  if setpwd(pass) <> rs("pass")  then
   dl = "0"
  else
   cs = rs("cs")
   if isnull(cs) then cs = 0
   cs = cs + 1
   zhsj = rs("zhsj")
   if isnull(zhsj) then zhsj = "第一次登陸"
   session(sessionvalue&"zhsj") = zhsj
   if jy="1" then
    Response.cookies("bbsyhm") = yhm
    Response.cookies("bbspass") = pass
   else
    Response.cookies("bbsyhm") = ""
    Response.cookies("bbspass") = ""
   end if
   session(sessionvalue&"pass")=pass
   session(sessionvalue&"yhm") = yhm
   session(sessionvalue&"lxfs") = rs("lxfs")
   session(sessionvalue&"sp") = rs("wz")
   session(sessionvalue&"id") = cstr(rs("id"))
   session(sessionvalue&"jb") = rs("jb")
   session(sessionvalue&"qm") = rs("qm")
   exec1 = "update yrwl_tb_admin set cs = "+cstr(cs)+",zhsj = '"+jdsj+"' where yhm = '"+yhm+"'"
   conn.execute exec1
   exec1 = "insert into yrwl_tb_dlxx (yhm,sj,ck) values ('"&yhm&"','"&jdsj&"','貼吧')"
   conn.execute exec1
   if cz = "index" then response.redirect "index.asp"
  end if
 else
  dl = "0"
 end if
 if dl = "0" then%>
  <script language="javascript">
  alert("使用者名稱或密碼錯!");
  if("<%=cz%>"=="bg") window.location="index.asp";
  window.location="tb_dl.asp";
  </script>
 <%else
  rs.close
  conn.close%>
  <script language="javascript">
  parent.window.location.href='index.asp';
  //parent.window.frames['bbslx'].location.href='bbs_lx.asp';
  ////window.location = "bbs_list.asp";
  </script>
 <%end if

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.