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

<%Call Head()
Call saycarda("发表评论")%>

<%
if myid<>0 then
else
Response.write "<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>请您先登陆...</a>"& chr(13)
Call headsay()
Response.End

End if

ids=trim(request.QueryString("class"))
if ids="" or IsNumeric(ids)=False then
  Call Error("ID无效！")
  end if
pl=request.form("pl")
p=trim(request.QueryString("p"))
id=trim(request.QueryString("id"))
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if

if pl="" then
  Call Error("评论内容不能为空！")
  end if
if len(pl)>300 then
  Call Error("评论内容最多300字！")
  end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from pl",conn,1,3
rs.addnew
rs("pl")=pl
rs("ip")=myni
rs("uid")=myid
rs("smsid")=id
rs("pltime")=now()
rs.update

'更新评论
dim Counts
Counts=conn.execute("Select count(ID) from [pl] where smsid="&id&"")(0)

conn.execute("update sms Set smspin = "&Counts&" where ID="&id)

response.write("评论发表成功！<br/>")
rs.close
Set rs=nothing
conn.close
set conn=nothing
%><a href='pilist.asp?id=<%=id%>&amp;class=<%=ids%>&amp;p=<%=p%>&amp;sid=<%=sid%>'>查看评论</a><br/>
<a href='article.asp?id=<%=id%>&amp;class=<%=ids%>&amp;p=<%=p%>&amp;sid=<%=sid%>'>返回上级</a><br/><a href='list.asp?class=<%=ids%>&amp;sid=<%=sid%>'>返回栏目</a><br/><a href='index.asp?sid=<%=sid%>'>返回首页</a>
<%Call headsay()%>