ASP Simple User Login code

Source: Internet
Author: User

<!--#include file= ". /inc/conn1.asp "<!--#include file=". /inc/md5.asp
<%
  If CStr (Request ("code")) <>cstr (Session ("GetCode")) then
     Response.Write "<script language=javascript>alert (' Sorry, you filled in the CAPTCHA error! ');"
    Response.Write "Javascript:history.go ( -1) </SCRIPT>"
    Response.End
 end If
  Dim Userid,password
  Username=request ("username")
   PASSWORD=MD5 (Request ("password"))
   set Rs=server. CreateObject ("Adodb.recordset")
   sql= "Select Username,vip,jifen1,lastlogin,thislogin,logins from Tgy where username= ' &username& ' and password= ' &password& ' '
   rs.open sql,conn,3,3
   If rs.eof   then
    response. Write "<script>alert (' User login error, username or password error '); History.go ( -1);</script> '
   else
     SessiOn (' username ') =rs ("username")
 if Day (rs ("Lastlogin")) <>day (date ()) then
 if rs ("jifen1") = " "Or IsNull (RS (" Jifen1 ")) then
 rs (" Jifen1 ") =5
 else
 rs (" Jifen1 ") =rs (" Jifen1 ") +5
 end if
 end if
 rs ("Lastlogin") =rs ("Thislogin")
 rs ("Thislogin") =now ()
 rs ("Logins") =rs ("logins") +1
 rs.update
    session.timeout=20
      Response. Write "<script>location.href= ' index.asp ';</script>"
   End If
   rs.close
   set rs=nothing
   conn.close
   set conn=nothing
  %>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.