<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/strutil.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="1;URL=<%=request.ServerVariables("HTTP_REFERER")%>">
</head>

<body>
<%
dim author,content,userip,classid,id,VerifyCode
VerifyCode =Trim(Request.Form("VerifyCode"))
if  VerifyCode <> CStr(Session("GetCode"))  then 
	Response.Write("<script>alert(""错误：\n验证码错误"");history.back();</script>")
	Response.End
end if
author=replace(trim(request.Form("author")),"'","")
if(checkForbidStr(author)=false) then
	response.Write("<script>alert(""您的评论中含有非法字符！"");history.back();</script>")
	response.End()
end if
author=tohtml(author)
content=replace(trim(request.Form("content")),"'","")
if(checkForbidStr(content)=false) then
	response.Write("<script>alert(""您的评论中含有非法字符！"");history.back();</script>")
	response.End()
end if
content=tohtml(content)
userip=GetIp()
classid=Cint(trim(request.Form("mode")))
id=Clng(trim(request.Form("id")))
if(content="" or len(content)<1) then
	response.Write("内容不能为空!")
	response.End()
end if
set rs=server.CreateObject("adodb.recordset") 
rs.open "select top 1 * from commen order by id desc",conn,3,3
rs.addnew
rs("username")=author
rs("content")=content
rs("moditime")=now
rs("classid")=classid
rs("articleid")=id
rs("userip")=userip
rs.update
rs.close
set rs=nothing
%>成功发表评论，正在转入，请稍候.................
</body>
</html>
<%
call connclose
%>
</body>
</html>
