Functions can refer to:
Copy Code code as follows:
<%
' Register forum user, parameter description
' Username User login name
' Password user has login password
' GroupID user group ID, senior member, user group ID 17; Full member, user group ID 18; Ordinary member, then user group ID is 10
' Email,realname,mobile,phone email, real name, cell phone, phone
Sub Regbbsuser (Username,password,groupid,email,realname,mobile,phone)
' Database connection
mm_conn_bbs_string= "Driver={sql Server};server=surui;uid=sa;pwd=sa;database=ntylswbbs;"
Set connbbs=server.createobject ("ADODB. Connection ")
Connbbs.open mm_conn_bbs_string
' Check to see if the user name exists
Checkuser= "SELECT * from dnt_users where username= '" &username ""
Set Checkuserrs=connbbs.execute (CheckUser)
If not checkuserrs.eof then
Haveuser= "true"
Else
Haveuser= "false"
End If
' If the user does not exist, increase the forum user
If haveuser= "false" then
' Update dnt_users (user information) table
Sql1= "SELECT * from Dnt_users"
Set Rs1=server.createobject ("ADODB. Recordset ")
Rs1.open sql1,connbbs,1,3
Rs1.addnew
Rs1 ("username") =username
Rs1 ("password") =md532 (password)
Rs1 ("GroupID") =groupid
Rs1 ("email") =email
Rs1.update
Rs1.close
' Read the ID of the newly created user
Sql2= "SELECT * from dnt_users where username= '" &username ""
Set Rs2=server.createobject ("ADODB. Recordset ")
Rs2.open sql2,connbbs,1,1
Useruid=rs2 ("UID")
Rs2.close
' Update dnt_userfields (user related information) table
Sql3= "SELECT * from Dnt_userfields"
Set Rs3=server.createobject ("ADODB. Recordset ")
Rs3.open sql3,connbbs,1,3
Rs3.addnew
RS3 ("UID") =useruid
If realname<> "" Then
RS3 ("Realname") =realname
End If
If mobile<> "" Then
RS3 ("mobile") =mobile
End If
If phone<> "" Then
RS3 ("Phone") =phone
End If
Rs3.update
Rs3.close
' Update dnt_statistics (Forum status information) table
Sql4= "SELECT * from Dnt_statistics"
Set Rs4=server.createobject ("ADODB. Recordset ")
Rs4.open sql4,connbbs,1,3
RS4 ("Totalusers") =rs4 ("Totalusers") +1
RS4 ("Lastusername") =username
RS4 ("Lastuserid") =useruid
Rs4.update
Rs4.close
End If
Connbbs.close
End Sub
' Call function
Call Regbbsuser ("ASP", "123456789", "123@163.com", "La la la", "13580351626", "0207235803")
%>