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
%>