Can anyone tell me with this code?
At the moment I enter an email into index.html and when I click submit the
email address passes to add_email.asp which writes the email to email.xml.
Have a look - www.madtim67.com
The code then shows the xml file on screen but I want to redirect it to
another page (just back to index.html). I've tried a few things but none of
them seem to have the desired effect.
add_email.asp
--------------
<% @LANGUAGE = "VBScript" %>
<%
Dim xmlFile
Dim xmlRoot
Dim xmlNode
Dim strTitle
Dim strError
Dim strPath
strPath = Server.MapPath( "db/email.xml")
Set xmlFile = Server.CreateOb ject("Microsoft .XMLDOM")
xmlFile.Async = False
If Not xmlFile.Load(st rPath) Then
Call Server.Transfer ("invalid.html" )
End If
Set xmlRoot = xmlFile.Documen tElement
Set xmlNode = xmlFile.CreateE lement("message ")
Call xmlNode.SetAttr ibute("timestam p", Now)
Call xmlRoot.AppendC hild(xmlNode)
Set xmlRoot = xmlNode
Call CreateElementNo de("user","user Name",xmlNode)
Call xmlFile.Save(st rPath)
Call Server.Transfer ("db/email.xml")
Sub CreateElementNo de(elementName, formElement, node)
Set xmlNode = xmlFile.CreateE lement(elementN ame)
xmlNode.Text = Request(formEle ment)
Call xmlRoot.AppendC hild(node)
End Sub
%>
P.S can anyone help me with checking to see if the email address entered
already exists in email.xml