<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->

<%
dim nm,username,id
id=trim(request("id"))
nm=Request.form("nm")
username=request("username")
hfname=request.cookies("jle")("username")
n=trim(request("n"))
ncom=trim(request("ncom"))
if n="" then
response.write "<li>参数错误！"
cl
response.end
end if
if nm="on" then
call jle()
else if hfname="" or request.cookies("jle")("domain")="" or request.cookies("jle")("id")="" then 
response.write "<br>"
response.write "<li>你还没有登陆！"
response.write "<meta http-equiv=refresh content=""2;URL=login.asp"">"
response.end
    else 
'    if request("jle")="chk" then
    call jle()
    response.end
'   end if
    end if
end if
%>

<%
sub jle()
dim rs,sql,neirong
if len(trim(request("neirong")))<2 or  len(trim(request("neirong")))>500  then
response.write "<li>评论内容小于2个字或字数超过500字！"
cl
response.end
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from shop_reply "
rs.open sql,conn,1,3
rs.addnew
rs("hfname")=hfname
'neirong=replace(replace(request("neirong"),chr(13),"<br>"),"   ","&nbsp;")
'neirong=HtmlEncodes(request("neirong"))
 neirong = HTMLEncodes(Request.Form("neirong"))
	neirong = Replace(neirong,"[em]","<img src='../shop/images/emot/em")
	neirong = Replace(neirong,"[/em]",".gif'>")

rs("neirong")=neirong
rs("sjname")=n
rs("sjcom")=ncom
rs("hfsj")=now()
rs("mi")=request("mi")
rs.update
rs.close
set rs=nothing
Conn.Execute("Update jle_shop Set plcs=plcs+1 where username='"&n&"'")
'Conn.Execute("Update jle_info Set fbsj=now() where id="&cstr(id))
closedb
Response.Write "<script language='javascript'>alert('评论成功！！');</script>" 
cl
end sub
%>
<%sub cl()
'response.write "<meta http-equiv=refresh content=""2;URL=shop/sp2.asp?m="&n&""">"
response.write "<meta http-equiv=refresh content='1;URL="&Request.ServerVariables("HTTP_REFERER")&"'>"
end sub%>