<!--#include file="byshop_conn.asp"-->
<%
ServerName1=Cstr(Request.ServerVariables("HTTP_REFERER"))
ServerName2=Cstr(Request.ServerVariables("SERVER_NAME"))
If Mid(ServerName1,8,len(ServerName2))<>ServerName2 Then
    Response.Write "路径有误，禁止从网站外部提交表单！"
     response.end

End if
%>
<%
Public Function FilterHtml(Str)
    If Trim(Str) = "" Or IsNull(Str) Then
        FilterHtml=""
    Else
    Str = Replace(Str, ">", "&gt;")
    Str = Replace(Str, "<", "&lt;")
    Str = Replace(Str, Chr(32), "&nbsp;")
    Str = Replace(Str ,Chr(9), "&nbsp;")
    Str = Replace(Str, Chr(34), "&quot;")
    Str = Replace(Str, Chr(39), "&#39;")
    Str = Replace(Str, Chr(13), "")
    Str = Replace(Str, Chr(10) & Chr(10), "</p><p>")
    Str = Replace(Str, Chr(10), "<br> ")
    FilterHtml = Str
    End If
End Function
classid=lcase(trim(request("classid")))
  if IsNumeric(request.form("classid"))=False or request.form("classid")="" then
	response.write"<SCRIPT language=JavaScript>alert('参数错1！');"
		response.write"javascript:history.go(-1)</SCRIPT>"
		response.end	
		end if		
pinlunid=lcase(trim(request("pinlunid")))
  if IsNumeric(request.form("pinlunid"))=False or request.form("pinlunid")="" then
	response.write"<SCRIPT language=JavaScript>alert('参数错误2！');"
		response.write"javascript:history.go(-1)</SCRIPT>"
		response.end	
		end if				  
		if classid=1 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from build where  id="&pinlunid,conn,1,1
					  	end if
					  	 	if classid=2 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from sell where  id="&pinlunid,conn,1,1
					  	end if
					  	 	if classid=3 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from sell2 where  id="&pinlunid,conn,1,1
					  	end if
					  	if classid=4 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from rent where  id="&pinlunid,conn,1,1
					  	end if
					  		if classid=5 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from rent2 where  id="&pinlunid,conn,1,1
					  	end if
					  		if classid=6 then
					  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select id from cotenancy where id="&pinlunid,conn,1,1
					  	end if
						if rs.bof and rs.eof then
						response.write"<SCRIPT language=JavaScript>alert('参数错误3！');"
						response.write"javascript:history.go(-1)</SCRIPT>"
						response.end
						end if
						rs.close
						set rs=nothing
						linkaddress=request.servervariables("http_referer")
												  	set rs=server.createobject("adodb.recordset")
					  	rs.open "select * from pl where  class="&classid&" and pinlunid="&pinlunid&" order by pinglundate desc ",conn,1,3
storey=rs("storey")
storey=storey+1
rs.addnew
rs("pinlunid")=pinlunid
rs("class")=classid
rs("userface")=trim(request.form("userface"))
rs("nickname")=FilterHtml(trim(request.form("nickname")))
rs("open")=int(request("open"))
rs("contact")=FilterHtml(trim(request.form("contact")))
rs("pingluncontent")=FilterHtml(trim(request.form("content")))
rs("pinglundate")=now()
userip=request.serverVariables("HTTP_X_FORWARDED_FOR")
if userip="" then
userip=request.serverVariables("REMOTE_ADDR")
end if 
rs("ip")=userip
rs("shenghe")=0
rs("storey")=storey
rs.update
response.Write "<script language=javascript>alert('发布成功，我们将在24小时内审核你发布的信息！');window.location.href='"&linkaddress&"';</script>"
 rs.close
set rs=nothing
 %> 
  