Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: server.execute

  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    server.execute

    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.

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, what is your question exactly?
    As easy as 3.1415926535897932384626433832795028841

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry its just I cannot pass the variables using server.execute, well at least I think I can't!! Is there any other way?

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    As easy as 3.1415926535897932384626433832795028841

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    Peterborough, UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why not just include the email script at the execution point in the page, then the variables can be called from the existing page.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course, cheers Whammy.

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

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Last edited by whammy; 02-14-2003 at 12:57 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •