<!-- #include file="common.asp" -->
<%
  if Trim(session("mangflag"))="" or Trim(session("timeflag"))="" then
    Response.redirect("noadmto.asp")
  end if
%>
<%
'------------------- v 1.4 解决留言不会换行的Bug-----------------------
  	content=HtmlEncode(Request.form("content"))
  	recontent=HtmlEncode(Request.form("recontent"))
'------------------- v 3.0 Security Encode -----------------------
	content 	= SecEncode( content )
	recontent	= SecEncode( recontent ) 

 set rs=server.createobject("ADODB.recordset")
 strsql="select * from guest where ID=" & Request("ID")
 rs.open strsql,conn,1,3
 'while not rs.eof
 'if Trim(rs("timeflag"))=Trim(request.form("timflg")) then
 'fgtime=Trim(rs("timeflag"))
  sTitle = Request.form("headline")
  sTitle = replace(sTitle, ">", "&nbsp;")
  sTitle = replace(sTitle, "<", "&nbsp;")
 if not rs.eof then
%>
<%
  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("nhead")
  rs("Title") = sTitle
  rs("Content")=content
	If Request.Form("RepUnabled")="1" Then
    rs("RepUnabled")=True
	Else
	  rs("RepUnabled")=False
  End If
  'if request.form("recontent")<>"" then
    'rs("repflag")=1
  'else
    'rs("repflag")=0
  'end if
  '--------如果"不显示回复"检查框为"1",则置回复标志为"假"!----------------------
  'if request.Form("rep")=1 then
    'rs("repflag")=0
  'end if 
  '--------V2.0----------------------------
 rs.update
%>
<!--
<%
'-------此处V2.0作了更改---------------------------------------------
'--------------------------
 'if rs("repflag")=True 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
%>
<%
    Response.Write "<script Language=Javascript>alert('修改留言成功!');</script>"
%>
<%
  'urlstr="manage.asp?currentpage="+Trim(Request("pn"))
  'response.Redirect urlstr
  urlstr="state.asp?state=modifysuc&pn="+Trim(Request("pn"))
  response.Redirect urlstr
%>
</body>
</html>
