Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


redirecting

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,35244
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> redirecting
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 redirecting - 6/8/2006 6:08:34 AM   
  madtim67

 

Posts: 1
Score: 0
Joined: 6/8/2006
Status: offline
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.CreateObject("Microsoft.XMLDOM")
xmlFile.Async = False

If Not xmlFile.Load(strPath) Then
Call Server.Transfer("invalid.html")
End If

Set xmlRoot = xmlFile.DocumentElement

Set xmlNode = xmlFile.CreateElement("message")
Call xmlNode.SetAttribute("timestamp", Now)
Call xmlRoot.AppendChild(xmlNode)

Set xmlRoot = xmlNode

Call CreateElementNode("user","userName",xmlNode)

Call xmlFile.Save(strPath)

Call Server.Transfer("db/email.xml")

Sub CreateElementNode(elementName, formElement, node)

Set xmlNode = xmlFile.CreateElement(elementName)
xmlNode.Text = Request(formElement)
Call xmlRoot.AppendChild(node)

End Sub

%>

P.S can anyone help me with checking to see if the email address entered
already exists in email.xml
 
 
Post #: 1
 
 RE: redirecting - 6/9/2006 1:46:02 AM   
  mrhayscom

 

Posts: 2
Score: 0
Joined: 6/9/2006
Status: offline
I could be wrong, not real strong with xml but here's a guess.// Call Server.Transfer("db/email.xml") // transfers execution to your xml page and the rest of the code on this page never executes. Server.Redirect might get you there have you tried that?

Mike

(in reply to madtim67)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> redirecting Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts