• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

discuz 2.0整合asp系统,用户添加函数

asp 搞代码 4年前 (2022-01-03) 60次浏览 已收录 0个评论

我的做法是,用户在原来的登录系统登录一次,记录用户名和密码明码,然后往数据库里面添加一个论坛用户(注意密码用32位的MD5),然后再用雪人的方法整合同步登录就可以了

函数可以参考:

代码如下:
<%
‘注册论坛用户,参数说明
‘username 用户登录名称
‘password 用户有登录密码
‘groupid 用户组id,高级会员,用户组id为17;正式会员,用户组id为18;普通会员,则用户组id为10
’email,realname,mobile,phone 电子邮件,真实姓名,手机,电话
sub regbbsuser(username,password,groupid,email,realname,mobile,phone)
‘数据库连接
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(用户相关信息)表
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.updat来源gao@!dai!ma.com搞$$代^@码网e
rs3.close

‘更新dnt_statistics(论坛状态信息)表
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 regbbsuser(“asp”,”123456789″,18,”[email protected]”,”啦啦啦”,”13580351626″,”0207235803″)
%>

以上就是discuz 2.0整合asp系统,用户添加函数的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:discuz 2.0整合asp系统,用户添加函数

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址