<!--#include file="CONN.ASP"-->
<!--#include file="config.asp"-->
<!--#include file="foxx.asp"-->
<!--#include file="usercookies.asp"-->
<%
dim rs,sql,reg1,ses,userip,pid
pid=request("pid")
reg1=request.cookies("fox")("reg1")
ses=DateDiff("s",reg1,now())
if ses<60 then
response.write "<script LANGUAGE='javascript'>alert('你的评论间隔是60秒，请等会再次发布！');history.go(-1);</script>"
response.end
end if
if len(request("neirong"))>100 then
response.write "<script LANGUAGE='javascript'>alert('评论内容太多，请简单填写！');history.go(-1);</script>>"
response.end
end if
if len(request("neirong"))<2 then
response.write "<script LANGUAGE='javascript'>alert('你没有填写评论内容！');history.go(-1);</script>"
response.end
end if
if request("neirong")="" then
response.write "<script LANGUAGE='javascript'>alert('非注册会员不能参加评论！');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from FOX_ping order by pjsj desc"
rs.open sql,conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("hao")=trim(request("hao"))
rs("huai")=trim(request("huai"))
rs("neirong")=trim(request("neirong"))
rs("pid")=trim(request("pid"))
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rs("ip")=userip
rs("pjsj")=now()
rs.update
Response.cookies("fox")("reg1")=now()
rs.close
set rs=nothing
closedb
	Response.Write"<script>alert('评论成功，感谢您的参与！');this.location.href='shangjiainfo.asp?id="&pid&"';</SCRIPT>"
response.write "<meta http-equiv=refresh content=""3;URL=shangjiainfo.asp?id="&pid&""">"
%></body></html>