欢迎光临爱时尚女性网
 

一个BBS的源代码(四)

2012-7-18 编辑:knwz 来源:爱时尚女性网 阅读次数:1237
  导读:'============================== Case "Write" '============================== ' 发表文章 %> 飞林庄->经验交流 账号: 密码: 题目: 有回复时发邮件通知我 ...
'==============================
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("时间")

    文章出自:爱时尚女性网www.aspjc.com,尊重版权是美德,转载请保留原地址,感谢合作!

  •  
     
    链接交换请联系:QQ:790646582 首页链接要求百度快照在一周以内,不符合以上要求的各站,我们将定期把友情连接转入内页,谢谢合作。
    Copyright @ 2012-2015 爱时尚女性网 保留所有权利吉ICP备14005127号-1 服务QQ:175529508 e-mail:zk8312@163.com
    本站部分资源来自网友上传,如果无意之中侵犯了您的版权,请联系本站,本站将在3个工作日内删除。