<%
function pinlun()
dsnstr.begintrans
   sql="insert into car_pinglun(username,title,uerid,pldate,content,ftitle,ip,xingmu)"&_
    "values('"&request.Form("username")&"','"&request.form("title")&"','"&id&"',"&_
	"'"&now()&"','"&request.Form("content")&"','"&request.Form("ftitle")&"',"&_
	"'"&request.ServerVariables("REMOTE_ADDR")&"','新闻')"
 
'response.Write(sql)
 call dsnstr.execute(sql)
     If abs(Err.number)=0 Then
	 dsnstr.committrans
		        Response.Write("<SCRIPT LANGUAGE=javascript>" & vbCrlf)
				Response.Write("if(window.alert(""成功评论，感谢您的支持！""))" & vbCrlf)
				Response.Write("</SCRIPT>")				    
		Else
		dsnstr.roallbacktrans
			Response.Write("插入数据出错，请重试！<br>")
			Response.Write ("Error#"&cstr(Err.number)&""&Err.Description)
			Err.Clear
			Response.End 
		End IF

end function
id=replace(request.QueryString("id"),"'","''")
mode=replace(request.QueryString("modify"),"'","''")
if id="" or isnumeric(id)=false then
	response.redirect "index.asp"
else
	id=clng(id)
end if
set rs=server.CreateObject("adodb.recordset")
if mode="y" then 
call pinlun()
 end if
%>