<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->
<%

call ling()
call head()
Call saycardd("发表评论")
dim ids,pin,id,pa,cid,TP
ids=trim(request.QueryString("class"))
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
  end if

TP=trim(request.QueryString("TP"))
if TP<>"" then TP=clng(TP)
pin=request.form("pin")
if pin="" then

  Call Error("评论内容不能为空！")
  end if

if len(pin)>300 then

  Call Error("评论字数不能大于300字！")
  end if

id=trim(request("id"))

if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if

pa=request.QueryString("pa")
if pa="" or IsNumeric(pa)=False then pa=1


ip=Request.ServerVariables("REMOTE_ADDR")

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from pin",conn,1,3
rs.addnew
rs("pin")=pin
rs("ip")=myni
rs("uid")=myid
rs("fileid")=id
if TP<>"" then rs("type")=1
rs("pltime")=now()
rs.update
response.write("评论发表成功！<br/>")
rs.close
Set rs=nothing
'更新评论
dim Counts
Counts=conn.execute("Select count(ID) from [pin] where fileid="&id&"")(0)

conn.execute("update wjfile Set filepin = "&Counts&" where ID="&id)
conn.close
set conn=nothing
%>
<a href='palist.asp?id=<%=id%>&amp;class=<%=ids%>&amp;cid=<%=cid%>&amp;pa=<%=pa%>&amp;TP=<%=TP%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>'>查看评论</a><br/>
<a href='picview.asp?id=<%=id%>&amp;class=<%=ids%>&amp;cid=<%=cid%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>'>返回上级</a><br/>
<a href='piclist.asp?class=<%=ids%>&amp;cid=<%=cid%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>'>返回栏目</a><br/>
<a href='index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>'>返回首页</a>
<%call head3()%>