欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

discuz 2.0整合asp系統(tǒng),用戶添加函數(shù)

 更新時(shí)間:2009年06月24日 23:49:38   作者:  
我的做法是,用戶在原來(lái)的登錄系統(tǒng)登錄一次,記錄用戶名和密碼明碼,然后往數(shù)據(jù)庫(kù)里面添加一個(gè)論壇用戶(注意密碼用32位的MD5),然后再用雪人的方法整合同步登錄就可以了
函數(shù)可以參考:
復(fù)制代碼 代碼如下:

<%
'注冊(cè)論壇用戶,參數(shù)說(shuō)明
'username 用戶登錄名稱
'password 用戶有登錄密碼
'groupid 用戶組id,高級(jí)會(huì)員,用戶組id為17;正式會(huì)員,用戶組id為18;普通會(huì)員,則用戶組id為10
'email,realname,mobile,phone 電子郵件,真實(shí)姓名,手機(jī),電話
sub regbbsuser(username,password,groupid,email,realname,mobile,phone)
'數(shù)據(jù)庫(kù)連接
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
'檢查用戶名是否存在
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 haveuser="false" then

'更新dnt_users(用戶信息)表
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

'讀取剛建立用戶的id
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

'更新dnt_userfields(用戶相關(guān)信息)表
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

'更新dnt_statistics(論壇狀態(tài)信息)表
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


'調(diào)用函數(shù)
call regbbsuser("asp","123456789",18,"123@163.com","啦啦啦","13580351626","0207235803")
%>

相關(guān)文章

最新評(píng)論