ASP do mailbox Activation login code

Source: Internet
Author: User

Many websites use the member registration function, after registering successfully needs the mailbox activation effect, today we will do this effect.
<%
Dim Username,password
Dim Repassword,answer
Dim Rs, SQL
If Trim (Request ("username")) = "" or Trim (Request ("pass") = "" or Trim (Request ("repass") = "" "or trim (Request (" answer ")) = "" Then
Response.Write "<script>alert (' Illegal parameters! '); History.go ( -1) </script> "
Else
Username = newasp.checkbadstr (Request ("username"))
Password = newasp.checkbadstr (Request ("Pass")
Repassword = MD5 (Newasp.checkstr (Request ("Repass"))
Answer = MD5 (Request ("answer"))
SQL = "Select Password,usergrade from [nc_user] WHERE username= '" & Username & "' and password= '" & Password & Amp "' and answer= '" & Answer & "'"
Set Rs = Server.CreateObject ("Adodb.recordset")
Rs.Open SQL, Conn, 1, 3
If rs.eof and Rs.bof Then
Response.Write "<script>alert (' You return the user information is incorrect, illegal operation!" '); History.go ( -1) </script> "
Else
If Rs ("usergrade") = 999 Then
Response.Write "<script>alert (' illegal operation! Must contact the administrator to retrieve the password! '); History.go ( -1) </script> "
Else
Rs ("password") = Repassword
Rs.update
'-----------------------------------------------------------------
' System integration
'-----------------------------------------------------------------
Dim Api_newasp,api_savecookie,syskey
If api_enable Then
Set api_newasp = New api_conformity
Api_newasp.nodevalue "Action", "Reguser", 0,false
Api_newasp.nodevalue "username", Username,1,false
Md5old = 1
SysKey = Md5 (Api_newasp.xmlnode ("username") & Api_conformkey)
Md5old = 0
Api_newasp.nodevalue "Syskey", Syskey,0,false
Api_newasp.nodevalue "Password", Request ("Repass"), 0,false
Api_newasp.sendhttpdata
Set api_newasp = Nothing
End If
'-----------------------------------------------------------------
Response.Write "<script>alert (' Your password is successfully activated, please login! '); Location.replace ('./') </script> "
End If
End If
Rs.close
Set Rs = Nothing
End If
Closeconn
%>

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.