Discuz 2.0 integrates the asp system and adds functions to users

Source: Internet
Author: User

For functions, refer: Copy codeThe Code is as follows: <%
'Register a forum user. parameter descriptions
'Username User Logon Name
'Password: the user has a logon password.
'Groupid user group id, senior member, user group id 17; formal member, user group id 18; common member, user group id 10
'Email, realname, mobile, phone, real name, mobile phone number
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 whether the user name exists
Checkuser = "select * from dnt_users where username = '" & username "'"
Set checkuserrs1_connbbs.exe cute (checkuser)
If not checkuserrs. eof then
Haveuser = "true"
Else
Haveuser = "false"
End if
'If the user does not exist, add a 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 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 the dnt_userfields 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 a function
Call regbbsuser ("asp", "123456789", 18, "123@163.com", "La la", "13580351626", "0207235803 ")
%>

Related Article

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.