<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Const dbdns="../"%>
<!--#include file="../AppCode/Conn.asp"-->
<%
Content = Left(Trim(Request.Form("Content")),250)
UserName = Trim(Request.Form("UserName"))
TypeID = Cint(Request.Form("TypeID"))
TableID = Cint(Request.Form("TableID"))
sID = Trim(Request.Form("sID"))
ErrStr = ""

url = "http://" & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") = 80 Then
Else
	url = url & ":" & Request.ServerVariables("SERVER_PORT")
End If
url = url & Replace(Request.ServerVariables("PATH_INFO"),"/pls.asp","/plw.asp")
url = url & "?id=" & TableID
If InStr(Request.ServerVariables("HTTP_REFERER"),url) <> 1 Then
	ErrStr = "验证失败，请重新输入。"
End If

If sID <> Session.SessionID Then
	ErrStr = "验证失败，请重新输入。"
End If

If InStr("|" & Lcase(Application(SiteID & "_Ok3w_SiteUserRegKillName")) & "|","|" & Lcase(UserName) & "|")>0 Then
	ErrStr = "禁止使用该用户发言，请重新输入。"
End If

If ErrStr = "" Then
	Sql = "select * from Ok3w_Guest where 1=2"
    Rs.Open Sql,Conn,1,3
    Rs.AddNew()
	Rs("pID") = 0
    Rs("UserName") = UserName
	Rs("Content") = Content
	Rs("TypeID") = TypeID
	Rs("TableID") = TableID
	Rs("AddTime") = Now()
	Rs("Ip") = Request.ServerVariables("REMOTE_ADDR")
	Rs("IsPass") = 0
	Rs("IsTop") = 0
	Rs("ReTime") = Now
	Rs("ReUser") = UserName
	Rs("Ad_Ask") = ""
	Rs.Update
	ErrStr = "恭喜，您的评论已经成功提交！管理员审核后，将会显示出来。"
End If

Set Rs = Nothing
Call CloseConn()
%>
<script type="text/javascript">
alert("<%=ErrStr%>");
location.href = "plw.asp?id=<%=TableID%>";
</script>