这是部分代码:(相关的插入、修改操作都实现不了,但网页显示成功,数据库里根本不变)
If comm_AlreadyMemErr=1 Then
'display password error
msg_Title="Error"
msg_Content="This username has been taken. And the username and password do not match.<br><br><a href='javascript:history.go(-1);'>Go Back</a>"
Session("comm_PasswordError")=Session("comm_PasswordError")+1
ElseIf Request.Form("comm_SaveMem")="1" And comm_AlreadyMemErr=0 Then
If Request.Form("comm_MemPassword")<>Empty Then
'Save new member
memName=CheckStr(Request.Form("comm_memName"))
Conn.ExeCute("INSERT INTO blog_Member(mem_Name,mem_Password,mem_IP,mem_Status) VALUES ('"&memName&"','"&MD5(Request.Form("comm_MemPassword"))&"','"&UserIP&"',3)")
memID=Conn.ExeCute("SELECT TOP 1 mem_ID FROM blog_Member WHERE mem_Name='"&memName&"'")(0)
Conn.ExeCute("UPDATE blog_Info SET blog_MemNums=blog_MemNums+1")
Response.Cookies(CookieName)("memName")=memName
Response.Cookies(CookieName)("memPassword")=MD5(Request.Form("comm_MemPassword"))
Else
msg_Title="Error"
msg_Content="Please input a password to register.<br><br><a href='javascript:history.go(-1);'>Go Back</a>"
End If
ElseIf comm_AlreadyMemErr<>2 Then
memName=CheckStr(Request.Form("comm_memName"))
memID=0
End If
End If
'Save comments
IF memName<>Empty AND comm_AlreadyMemErr<>1 Then
Dim log_ID,comm_Content,comm_memName,comm_Hidden,comm_Highlight
comm_Content=CheckBadWords(CheckStr(Request.Form("message")))
comm_memName=memName
comm_Hidden=Request.Form("comm_Hidden")
comm_Highlight=Request.Form("comm_Highlight")
IF Not IsInteger(comm_Hidden) Then comm_Hidden=0
IF Not IsInteger(comm_Highlight) Then comm_Hidden=0
strSQL="INSERT INTO blog_Gb(gb_Userid,gb_Username,gb_Content,gb_Hidden,gb_Ip,gb_Highlight) VALUES ("&memID&",'"&memName&"','"&comm_Content&"',"&comm_Hidden&",'"&UserIP&"',"&comm_Highlight&")"
connGB.ExeCute("UPDATE blog_Member SET mem_PostComms=mem_PostComms+1 WHERE mem_Name='"&comm_memName&"'")
connGB.ExeCute("UPDATE blog_Info SET blog_CommNums=blog_CommNums+1")
connGB.ExeCute("UPDATE blog_Toolbox SET tb_Nums=tb_Nums+1 WHERE tb_Name='Guestbook'")
'Check if topic allow comment
If comm_Content="" Then
msg_Title="Error"
msg_Content="Your post contains words which is not allowed.<br><br><a href='javascript:history.go(-1);'>Go Back</a>"
Else
connGB.Execute(strSQL)
Session("memLastpost")=Now()
msg_Title="Done"
msg_Content="Post Successful<br><br><a href='?'>Go Back</a><meta http-equiv='refresh' content='2;url=?'>"
谢谢大侠指点·!!!