'显示留言函数init()
'www.knowsky.com
Function init()
entryForm()
'定义局部变量
Dim objXML
Dim arrNames
Dim arrEmails
Dim arrURLS
Dim arrMessages
'创建XMLDOM文档对象,用来存放留言
Set objXML = server.createObject("Msxml2.DOMDocument")
objXML.async = false
objXML.load(server.MapPath("guestbook.xml"))
'取得留言本各元素的集合
Set arrNames = objXML.getElementsByTagName("留言者姓名")
Set arrEmails = objXML.getElementsByTagName("电子邮件")
Set arrURLS = objXML.getElementsByTagName("网址")
Set arrMessages = objXML.getElementsByTagName("留言内容")
End Function
%>
<html>
<head>
<title>XML 留言例子</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
'判断是否发送了留言,并更新留言信息
Dim a
a = Request.Querystring("action")
If a<>"" Then
addEntry
else
init
End If
%>
</body>
</html>