<!-- #include file="opendb.asp" -->
<%
  if Trim(session("mangflag"))="" or Trim(session("timeflag"))="" then
    Response.redirect("noadmto.asp")
  end if
%>
<%
'------------------- v 1.4 解决留言不会换行的Bug-----------------------
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", "&gt;")
fString = replace(fString, "<", "&lt;")

fString = Replace(fString, CHR(32), "&nbsp;")
fString = Replace(fString, CHR(9), "&nbsp;")
fString = Replace(fString, CHR(34), "&quot;")
fString = Replace(fString, CHR(39), "&#39;")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
end if
end function
'------------------- v 1.4 解决留言不会换行的Bug-----------------------
%>
<%
'------------------- v 1.4 解决留言不会换行的Bug-----------------------
  content = HtmlEncode(Request.form("content"))
  'recontent=HtmlEncode(Request.form("recontent"))
  
'------------------- v 3.0 Security Encode -----------------------
  content = SecEncode( content )
  
'------------------- v 1.4 解决留言不会换行的Bug-----------------------
 set rs=server.createobject("ADODB.recordset")
 strsql="select * from news"
 rs.open strsql,conn,1,3
 if not rs.eof then
 'while not rs.eof
 'if Trim(rs("timeflag"))=Trim(request.form("timflg")) then
 'fgtime=Trim(rs("timeflag"))
%>
<%
  rs("name")=Request.form("name")
  rs("sex")=Request.form("sex")
  rs("address")=Request.form("address")
  rs("email")=Request.form("email")
  rs("homepage")=Request.form("homepage")
  rs("Oicq")=Request.form("oicq")
  rs("headpic")=Request.form("headpic")
  rs("Title")=Request.form("headline")
  rs("Content")=content
  'if request.form("recontent")<>"" then
    'rs("repflag")=1
  'else
    'rs("repflag")=0
  'end if
  'if request.Form("rep")=1 then
    'rs("repflag")=0
  'end if 
  rs("Date")=Date()
  rs("Time")=Time()
 rs.update
%>
<%
 'if Trim(rs("repflag"))<>False then 
 'set rsb=Server.CreateObject("ADODB.Recordset")
'-------此处进行了更改V1.1-------------------------------------------
 'strsqlb="select * from reply where timeflag='"&Trim(rs("timeflag"))&"'"
 'rsb.open strsqlb,conn,1,3
   'if rsb.recordcount>0 then     
	 'rsb("content")=recontent
	 'rsb.update	   
   'else
	 'rsb.addnew
	   'rsb("timeflag")=Trim(rs("timeflag"))
	   'rsb("content")=recontent
	 'rsb.update
   'end if
   'rsb.close
   'set rsb=nothing
 'end if 
'---------------------------------------------------------------------
%>
<%
 end if
 'rs.movenext
 'wend
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
%>
<%
  urlstr="state.asp?state=mnewssuc&pn="+Trim(Request("pn"))
  response.Redirect urlstr
%>
</body>
</html>
