<%@ Language=VBScript %>
<!--#INCLUDE FILE="conn.asp" -->

<%

'----------------读取数据------------------------------
carId = request.Form("carId")			'汽车的ID号
name=left(request("name"),30)
nr=left(request("nr"),500)
newsID=request("ID")
tel=trim(request.form("tel"))
mm=trim(request.form("name1"))
name=trim(request.form("name"))
if name="" then ze="游客"
if name="" then '--------------判断名字
		response.write "<script language='javascript'>" & VbCRlf
	    response.write "alert('请填入你的名字');" & VbCrlf
	    response.write "history.go(-1);" & vbCrlf
	    response.write "</script>" & VbCRLF
	    response.end
end if

'-------------------下次写个全的OICQ的判断--------------
if nr="" then
	    response.write "<script language='javascript'>" & VbCRlf
	    response.write "alert('内容不能为空');" & VbCrlf
	    response.write "history.go(-1);" & vbCrlf
	    response.write "</script>" & VbCRLF
	    response.end
end if

'------以下写入留言---------------
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from ly"
rs.open sql,conn,3,2
rs.addnew

		rs("name")=name
		rs("tel")=tel
		rs("memberid")=mm
		rs("newsID")=request("newsID")
		rs("nr")=nr
		rs("date")=now()
		rs("rip")=Request.ServerVariables("REMOTE_HOST")
		rs.update
		rs.close
         response.write "<script>alert('发表成功!');location.href='view2Car.asp?id="& carId &"';</Script>"

'===============================================================================================
'是否要给此拥护的易卡贝贝加值
if session("userId23") <> "" then
	set rs_4 = server.CreateObject("adodb.recordset")
	rs_4.open "select * from userJiFen where userId= "& session("userId23") &"",conn,1,3
	if not rs_4.eof then
		
		tmp_23 = rs_4("tmp_plNum")
		tmp_23 = tmp_23 + 1
		if tmp_23 >= 10 then
			rs_4("yikabeibei") = rs_4("yikabeibei") + 1
			rs_4("tmp_plNum")  = 0
		else
			rs_4("tmp_plNum") = tmp_23
		end if
		rs_4.update
	end if
	rs_4.close
	set rs_4 = nothing
end if
%>