熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp簡單用戶登陸代碼

2013-11-13 10:42:44  來源: .NET編程 

  <! #include file="/inc/connasp">
<! #include file="/inc/mdasp">
<%
  if cstr(request("code"))<>cstr(session("getcode")) then
    responsewrite"<SCRIPT language=JavaScript>alert(對不起你填寫的驗證碼錯誤!);"
    responsewrite"javascript:historygo()</SCRIPT>"
    responseend
 end if
  dim useridpassword
  username=request("username")
   password=md(request("password"))
   set rs=serverCreateObject("adodbrecordset")
   sql="select usernamevipjifenlastloginthisloginlogins from tgy where username="&username&"and password="&password&""
   rsopen sqlconn
   if rseof   then
    responseWrite "<script>alert(用戶登錄出錯用戶名或者密碼錯誤);historygo();</Script>"
   else
    session("username")=rs("username")
 if day(rs("lastlogin"))<>day(date()) then
 if rs("jifen")="" or isnull(rs("jifen")) then
 rs("jifen")=
 else
 rs("jifen")=rs("jifen")+
 end if
 end if
 rs("lastlogin")=rs("thislogin")
 rs("thislogin")=now()
 rs("logins")=rs("logins")+
 rsupdate
    sessiontimeout=
     responseWrite "<script>location;</Script>"
   end if
   rsclose
   set rs=nothing
   connclose
   set conn=nothing
   %>


From:http://tw.wingwit.com/Article/program/net/201311/14351.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.