discuz 2.0整合asp系统,用户添加函数
来源:asp之家 发布时间:2011-04-02 11:08:00
函数可以参考:
<%
'注册论坛用户,参数说明
'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.update
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,"123@163.com","啦啦啦","13580351626","0207235803")
%>
猜你喜欢
- 一、下载MySQL 访问MySQL的官网http://www.mysql.com/downloads/&
- re.search():匹配整个字符串,并返回第一个成功的匹配。如果匹配失败,则返回None pattern: 匹配的规则,str
- Vue 路由传参加密首先,创建一个base64.jsconst Base64 = { //加密 en
- my.ini文件[mysqld]max_allowed_packet = 10M
- MD5(Message-Digest Algorithm 5) 模块用于计算信息密文(信息摘要),得出一个128位的密文。sha模块跟md5
- MySQL 5.7安装、升级笔记分享:卸载当前的 MySQL查看当前 MySQL 版本:[root@coderknock ~]# mysql
- 在二维卷积函数tf.nn.conv2d(),最大池化函数tf.nn.max_pool(),平均池化函数tf.nn.avg_pool()中,卷
- SQLAlchemy是Python编程语言下的一款开源软件,提供了SQL工具包及对象关系映射(ORM)工具,使用MIT许可证发行。SQLAl
- 报错selenium.common.exceptions.WebDriverException: Message: Element is n
- Macromedia Dreamweaver MX 2004提供了更多功能强劲的可视化设计工具、应用开
- 前言MySQL是目前非常流行的数据库之一,也是中小企业持久化存储的首选数据库。不同于我们日常学习,在实际应用中,MySQL服务都会挂载在某台
- sql server端口,我们可以通过\"服务器端网络试用工具\"和\"客户端实用工具\"来设定,设
- 问题某些无聊的脚本小子在Web页面表单中填入了“pýtĥöñ”这样的文本,我们
- 项目内容:用Python写的糗事百科的网络爬虫。使用方法:新建一个Bug.py文件,然后将代码复制到里面后,双击运行。程序功能:在命令提示行
- 这段时间写了很多页面代码,除了一些知识重复以外,也学到css的一些新东西,或许是旧东西,但是还是希望能对大家有用。其实在css里面有很多对a
- 本文实例总结了python中日期和时间格式化输出的方法。分享给大家供大家参考。具体分析如下:python格式化日期时间的函数为datetim
- 一个小需求---实现车牌识别。目前有两个想法1. 调云在线的接口或者使用SDK做开发(配置环境和编译第三方库很麻烦,当然使用python可以
- 本文实例为大家分享了python文件写入write()的操作的具体代码,供大家参考,具体内容如下filename = 'pragra
- 要判断一个模块是否安装,非常简单,在终端中进入python,然后输入import 模块名。然后如果安装成功没有任何提示,直接显示下一行交互,
- MySQL设置当前时间为默认值的问题我们经常会遇到,下面就为您介绍MySQL设置当前时间为默认值的实现全步骤,希望对您能有所启迪。数据库:t