<% @CODEPAGE=936 %>
<% response.charset = "GBk" %>
<%
'//*************************************************************************
const FileName = "CommentAutoSave.xml"
'//*************************************************************************

From_url = Cstr(Request.ServerVariables("HTTP_REFERER")) 
Serv_url = Cstr(Request.ServerVariables("SERVER_NAME")) 
if mid(From_url,8,len(Serv_url)) <> Serv_url then
'response.end 
end if 

on error resume next
If Request.form.Count <>"" Then 
	Set objXmlFile = Server.CreateObject("Microsoft.XMLDOM")
	objXmlFile.async = False
	Set objPI = objXmlFile.createProcessingInstruction("xml","version='1.0' encoding='utf-8'")
	objXmlFile.insertBefore objPI, objXmlFile.childNodes(0)
	Set root = objXmlFile.createElement("AllDate") 
	Set objXmlFile.documentElement = root
	For Each Query In Request.form
		If Request.form(Query)<>"" then
			Set filenode = objXmlFile.createNode("element", Query, "") 
			filenode.Text = Request.form(Query)
			root.appendChild filenode
		end if
	Next
	objXmlFile.save Server.MapPath(FileName)
End If 

If Err.Number=0 then
	Response.Write "<span style=""background-color: #FFDD3E;"">&nbsp;"&formatdatetime(now,4)&":"&Right("0"&second(now),2)&"<a href="&FileName&" target=""_blank"" style=""text-decoration: none;"">±£´æ²Ý¸å³É¹¦</a>&nbsp;</span>"
Else
	Response.Write "<span style=""background-color: #FFDD3E;"">&nbsp;"&formatdatetime(now,4)&"±£´æ²Ý¸åÊ§°Ü&nbsp;"&Err.Number&Err.description&"</span>"
End If

Function HTMLEncode(str)
    IF(str <> "")THEN
        str = Replace(str, "&", "&amp;")
        str = Replace(str, ">", "&gt;")
        str = Replace(str, "<", "&lt;")
        str = Replace(str, Chr(32), "")
        str = Replace(str, Chr(9), "")
        str = Replace(str, Chr(34), "&quot;")
        str = Replace(str, Chr(39), "&#39;")
        str = Replace(str, Chr(13), "")
        str = Replace(str, Chr(255), "")
    END IF
    HTMLEncode = str
End Function
%>
