![]() |
购物专题 | 基金专题 | 性专题 | 饮食专题 | 教育专题 | 生活大参考 | 园林资讯 | 园艺库 | 健康专题 | |
| 论文专题 | 家庭养花 | 园林景观 | 盆景奇石 | 激情图库 | 农业资料库 | 园林古建 | 英文站 | 花卉栽培 |
第16行有错。
<%
username=request.form("username")
if username<>"" then
fromwhere =request.form("fromwhere")
homepage =request.form("homepage")
email =request.form("email")
text =request.form("text")
text =replace(text,"<","<")
Posttime =now()
strSourceFile = Server.MapPath("/") & "\List.xml"
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.load(strSourceFile)
Set objRootlist = objXML.documentElement.selectSingleNode("NewList")
if objRootlist.hasChildNodes then
id = objRootlist.lastchild.firstchild.text+1
(firstchild)
else
id=1
end if
brstr=chr(13)&chr(10)&chr(9)
XMLnode=brstr&"<list>"&brstr & _
"<id>"&id&"</id>"&brstr & _
"<username>"&username&"</username>"&brstr & _
"<fromwhere>"&fromwhere&"</fromwhere>"&brstr & _
"<Posttime>"&Posttime&"</Posttime>"&brstr & _
"<homepage>"&homepage&"</homepage>"&brstr & _
"<email>"&email&"</email>"&brstr & _
"<text>"&text&"</text>"&brstr & _
"</list>"&chr(13)
set objXML2=Server.CreateObject("Microsoft.XMLDOM")
objXML2.loadXML(XMLnode)
set rootNewNode=objXML2.documentElement
objRootlist.appendChild(rootNewNode)
objXML.save(strSourceFile)
set objXML=nothing
set objXML2=nothing
response.write "Thanks your B."
response.end
end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
-->
</style>
</head>
<body bgcolor="#0099CC" text="#000000">
<table width="80%" border="0" cellspacing="1" cellpadding="4" align="center" bgcolor="#FFFFFF">
<form action="PostNew.asp" method="post" name="form1">
<tr bgcolor="#000000">
<td colspan="2"><font color="#FFFFFF">New Book</font></td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right">Name:</td>
<td width="81%">
<input type="text" name="username">
** </td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right">ComeFrom:</td>
<td width="81%">
<input type="text" name="fromwhere" value="China">
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right">WebSite:</td>
<td width="81%">
<input type="text" name="homepage" value="http://">
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right">Email:</td>
<td width="81%">
<input type="text" name="email">
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right" valign="top">Context:</td>
<td width="81%">
<textarea name="text" cols="60" rows="10"></textarea>
</td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="19%" align="right"> </td>
<td width="81%">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</td>
</tr>
</form>
</table>
</body>
</html>
---------------------------------------------------------------
1.16行 删除
2.list.xml(初始文件)
<?xml version="1.0" encoding="gb2312"?>
<Data>
<NewList>
</NewList>
</Data>
:_)
---------------------------------------------------------------
我斗胆贴出自己的一个程序来,也是类似功能的!
函数:添加条目
Function AddPersonData(oXMLCode)
Dim sourceFile,xObj1,xObj2
Dim rootNode,newNode,currentNode
AddPersonData = 0
sourceFile = Request.ServerVariables("APPL_PHYSICAL_PATH") & "IntroDir.xml"
Set xObj1 = Server.CreateObject("Microsoft.XMLDOM")
Set xObj2 = Server.CreateObject("Microsoft.XMLDOM")
xObj1.load(sourceFile)
Set rootNode = xObj1.documentElement
If Not IsObject(rootNode) Then
Exit Function
End if
xObj2.loadXML(oXMLCode)
Set newNode = xObj2.documentElement
Set currentNode = rootNode.appendChild(newNode)
xObj1.save(sourceFile)
浙ICP备 :07003766号 Copyright © 2001-2007 JUBAO163,All rights reserved. |