...

View Full Version : server.execute



Leeus
02-12-2003, 12: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.

head8k
02-12-2003, 12:46 PM
Sorry, what is your question exactly?

Leeus
02-12-2003, 12: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?

head8k
02-12-2003, 12: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?

raven
02-13-2003, 12: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.

whammy
02-13-2003, 12: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.

Leeus
02-13-2003, 09:03 AM
Of course, cheers Whammy.

Is it better to put it in a sub or Func?

whammy
02-13-2003, 11:52 PM
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.:

http://www.solidscripts.com/downloads/functions.txt

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):

http://www.solidscripts.com/email.txt

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.

:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum