discuz 2.0整合asp系統(tǒng),用戶添加函數(shù)
<%
'注冊(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)文章
asp下利用fso實(shí)現(xiàn)文件夾或文件移動(dòng)改名等操作函數(shù)
以后利用fso來(lái)操作文件和文件夾就方便了2008-01-01ASP獲取ACCESS數(shù)據(jù)庫(kù)表名及結(jié)構(gòu)的代碼
此方法可獲得ACCESS數(shù)據(jù)的表名及其結(jié)構(gòu),數(shù)據(jù)類型等... 程序過(guò)濾了幾個(gè)ACCESS數(shù)據(jù)庫(kù)的幾個(gè)隱藏表(可能是導(dǎo)致ACCESS數(shù)據(jù)庫(kù)刪除數(shù)據(jù)還會(huì)變大的原因)2008-08-08Asp中Server.ScriptTimeOut屬性需要注意的一點(diǎn)分析
Server.ScriptTimeout 這個(gè)屬性給定Asp腳本執(zhí)行的最大時(shí)間,如果asp程序的運(yùn)行時(shí)間超過(guò)了這個(gè)屬性規(guī)定的值,Asp就會(huì)報(bào)錯(cuò)。2011-06-06asp動(dòng)態(tài)include文件,方便多模板的實(shí)現(xiàn)
asp動(dòng)態(tài)include文件,方便多模板的實(shí)現(xiàn)...2007-08-08通過(guò)表單的做為二進(jìn)制文件上傳request.totalbytes提取出上傳的二級(jí)制數(shù)據(jù)
通過(guò)表單的做為二進(jìn)制文件上傳request.totalbytes提取出上傳的二級(jí)制數(shù)據(jù)的代碼說(shuō)明。2009-09-09ImageMagickObject獲取圖片的信息無(wú)返回值的解決辦法
這篇文章主要介紹了ImageMagickObject獲取圖片的信息無(wú)返回值的解決辦法,非常簡(jiǎn)單,加上format參數(shù)即可,需要的朋友可以參考下2015-05-05新增加一個(gè)防垃圾評(píng)論的asp代碼,鄙視垃圾
最近開通了,可以發(fā)表評(píng)論就一直被垃圾評(píng)論和留言困擾,一直沒有找到很好的解決辦法。今天發(fā)現(xiàn)了這個(gè)可以防止垃圾評(píng)論的asp代碼,特提供給大家,希望大家能擺脫2007-12-12asp實(shí)現(xiàn)取得數(shù)組中的最大值的代碼
asp實(shí)現(xiàn)取得數(shù)組中的最大值的代碼...2007-08-08