View Full Version : server.execute
02-12-2003, 01:39 PM
I have created a page that will fire an e-mail off but it needs 4 variables every time. Ideally I wanted to use the server.execute or similar method just to run the page then close it.
02-12-2003, 01:46 PM
Sorry, what is your question exactly?
02-12-2003, 01:48 PM
Sorry its just I cannot pass the variables using server.execute, well at least I think I can't!! Is there any other way?
02-12-2003, 01:53 PM
Stick them in a session variable? pass them on the querystring to your new page? set a cookie and pick it up on the next page?
02-13-2003, 01:47 AM
Why not just include the email script at the execution point in the page, then the variables can be called from the existing page.
02-13-2003, 01:58 AM
Post the page to itself, and only send the email (using a subroutine) if all of the variables pass your validation criteria?
That's the way I usually do stuff in ASP, anyway.
02-13-2003, 10:03 AM
Of course, cheers Whammy.
Is it better to put it in a sub or Func?
02-14-2003, 12:52 AM
Unless you need to return a value, use a Sub...
Subs can accept parameters to process, but not return values...
Functions are designed to return a value... i.e.:
P.S. for an example of this technique of calling different subroutines depending on your logic, check this script out (it's a very simple one, but it should give you the idea):
Since Visual Basic Scripting Edition is not Object Oriented, I took the BASIC (the language, I mean) approach I learned as a kid and applied it to VBScript... I used to use a BUNCH of Subroutines (not to mention DATA statements!) in BASIC when it was popular.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.