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


<%

call head()
Call saycardd("发表评论")
dim ids,pl,id
ids=trim(request.QueryString("ids"))

pl=request.form("pl")
if pl="" then

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

if len(pl)>300 then

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

id=trim(request("id"))

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

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from photopl",conn,1,2
rs.addnew
rs("photopl")=pl
rs("pluser")=myni
rs("userid")=myid
rs("photoid")=id
rs("times")=now()
rs.update
response.write("评论发表成功！<br/>")
rs.close
Set rs=nothing
dim photoCount
	photoCount=conn.execute("Select count(ID) from [photopl] where photoid="&id&"")(0)	
conn.execute("update upfile Set photoCount = "&clng(photoCount)&" where id="&id)
conn.close
set conn=nothing
	response.write("--------<br/><a href=""photobbs.asp?id="&id&"&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">查看评论</a><br/>")
	response.write("<a href=""photoview.asp?id="&id&"&amp;ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">查看相片</a><br/>")

	response.write("<a href=""photo.asp?ids="&ids&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回相册</a><br/>")
	response.write("<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区首页</a>")
Call headsay()
%>