bbs的html代码,一个BBS的源代码(四)

==============================

case "write"

==============================

发表文章

%>

================================

case "add","reply"

================================

把文章加进数据库

检查数据

userid = trim(request("userid"))

password = trim(request("password"))

title = trim(request("title"))

content = rtrim(request("content"))

if request("mailme") = "yes" then mailme = 1 else mailme = 0

wrongmsg = ""

if userid = "" then wrongmsg = wrongmsg + "

请输入你的账号。"

if password = "" then wrongmsg = wrongmsg + "

请输入你的密码。"

if title = "" then wrongmsg = wrongmsg + "

请输入文章题目。"

if content = "" then wrongmsg = wrongmsg + "

请输入内容。"

if wrongmsg = "" then

userid = sqlstr( userid )

password = sqlstr( password )

title = sqlstr( title )

content = sqlstr( content )

检察账号与密码

sql = "select count(*) from bbsmember where [账号]=" & userid & " and [密码]=" & password & ""

recmember.open sql , con , 1

if recmember.fields(0).value = 0 then memberexist = true else memberexist = false

recmember.close

if memberexist then

wrongmsg = wrongmsg + "

用户名不存在或者密码不对。"

else 加进数据库

if job = "add" then

sql = "insert into bbs ([作者],[题目],[内容],[邮件通知]) values(" &_

sqlstr( userid ) & "," &_

sqlstr( title ) & "," &_

sqlstr( content ) & "," &_

mailme & ")"

else

回复文章数加一

con.execute( "update bbs set [回复]=[回复]+1 where [序号]=" & session("bbs_which") )

邮件通知原作者

sql = "select [题目],[时间],[邮件通知] from bbs where [序号]=" & session("bbs_which")

recbbs.open sql , con , 1

if recbbs.fields("邮件通知") then

firsttitle = recbbs.fields("题目")

writetime = recbbs.fields("时间")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值