473,654 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirecting

Jim
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
Jun 7 '06 #1
2 1339
Bo
Jim,

Your call 'Call Server.Transfer ("db/email.xml")' does just that - the
server stops executing your ASP script (presumably add_email.asp) at
that point and switches to executing email.xml instead. All the server
does with email.xml is to send it to the browser. So your code after
that Server.Transfer call never gets executed.

What you would do is to put Call Server.Transfer ("index.html ") as your
very last statement. And do whatever you intend to to with email.xml
before that.

/Bo

Jim wrote:
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


Jun 9 '06 #2
jim
Thanks very much, i cant believe I never saw that.
Bo wrote:
Jim,

Your call 'Call Server.Transfer ("db/email.xml")' does just that - the
server stops executing your ASP script (presumably add_email.asp) at
that point and switches to executing email.xml instead. All the server
does with email.xml is to send it to the browser. So your code after
that Server.Transfer call never gets executed.

What you would do is to put Call Server.Transfer ("index.html ") as your
very last statement. And do whatever you intend to to with email.xml
before that.

/Bo

Jim wrote:
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

Jun 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5060
by: Ivo Woltring | last post by:
Hi Pythoneers, I am trying to make my own gui for mencoder.exe (windows port of the terrific linux mencoder/mplayer) to convert divx to Pocket_PC size. My current app creates a batch script to run the mencoder with the needed params, but now I want to integrate mencoder as a subprocess in my app. What already works: the starting of the subprocess.Popen and the subsequent killing of the process if I want it to.
10
1865
by: Kenneth Keeley | last post by:
Hi, I have been having problems with Gecko based browsers not redirecting properly. This is the line of code that does the redirecting: Response.Redirect ("Validation.asp?BookingNo=1234567") The Gecko based browsers change this URL to read "Validation BookingNo=1234567" and of course they get a 404 Error as a result. The above code works on every other browser without fault. So why do Gecko based
0
2577
by: Christophe HELFER | last post by:
hi, I have some problem with redirecting input and output from a process. I can only use VB language (sorry...) Situation: I have to use the Cisco Network Registrar (DNS And DHCP server) command line utility as redirecting its input and output so I can interact with this one. This utility is similar to ftp under a win32 console. It proposes its own prompt after launching it.
3
2322
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the main page from the code behind the contents page. I want to do this to allow the use of asp "linkbuttons" instead of hyperlinks so I can do a little processing before redirecting. The main reason for this to prevent hyperlinks of pages that have...
0
2132
by: Sune Hansen | last post by:
Hi guys, I really hope someone can help me with my problem. Here is the scenario: I have a development environment on my locale machine. Once in a while when everything has been tested I publish it to the live server. This has been working well for some time. Now, all of a sudden, when I publish my site it no longer works on the live server. It seemes as if it keeps redirecting to the same page over and over
1
1853
by: Bilbo | last post by:
Hello, How do I programatically redirect a page in "another frame" using C# in ASP.NET? Server.Transfer redirects the current page...not a different frame. Thanks.
3
2459
by: tony | last post by:
I've been searching through the threads to find a solution for 401.3 error triggered by windows authentication not being able to redirect to a custom error page to no avail. It seems that ASP.NET does not redirect 401 errors yet changing the Custom Errors redirect in IIS does not help either. Has anyone found a solution to this problem? Seems like it should be a commonly encountered problem. Any help will be greatly appreciated.
4
1487
by: Greg Smalter | last post by:
Redirecting from page to page within a web project is pretty easy. However, all Redirect methods take strings as arguments, as if you mistype the string, you don't find out until run time that you are redirecting to somewhere that doesn't exist. Worse, if you do type it correctly, but then later the page name changes or the page moves, you still won't find out until run time. I have a framework that solves this problem and guarantees,...
8
5778
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can technically create an executable that calls the function and then using a command prompt call the exexutable using the > output.txt redirector but I would prefer to do everything within the application itself. Is there a way for force an output...
17
9460
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to redirect: Response.Redirect("/website/pdffiles/myreport.pdf"); Response.End; IE opens a "File Download" box and if you click the "open" button then
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.