<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% response.charset="utf-8" %>
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="../Include/Const.asp" -->

<%
dim id
id=trim(request.querystring("Id"))
if id="" or isnull(id) or not isnumeric(id) then
response.write("<script language='javascript'>alert('参数错误!');history.back();</script>")
response.end()
end if
If Trim(Request.Form("validatecode"))=Empty Or Trim(Session("cnbruce.com_ValidateCode"))<>Trim(Request.Form("validatecode")) Then
response.write("<script language='javascript'>alert('验证码错误!');history.back();</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
set rs=conn.execute("select * from ameav_Products where id="&int(id))
if rs.eof then 
response.write("<script language='javascript'>alert('参数错误!');history.back();</script>")
response.end()
end if
set rs=nothing
nick=Trim(Request.Form("nick"))
qq=Trim(Request.Form("qq"))
info=Trim(Request.Form("info"))
if nick="" or info="" then
response.write("<script language='javascript'>alert('昵称和内容必须填写!');history.back();</script>")
response.end()
end if
if len(info)>200 then
response.write("<script language='javascript'>alert('评论内容不能多于200字!');history.back();</script>")
response.end()
end if
Set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from ameav_pl"
rs.Open sql,conn,1,3
rs.Addnew
rs("nick")=nick
rs("qq")=qq
rs("info")=info
rs("pid")=id
rs("sh")=plsh
rs.Update
rs.Close
Set rs=Nothing

Response.write("<script language='javascript'>alert('发表评论成功!');location.href='AmvoteView.asp?id="&id&"';</script>")
%>