Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 918765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:25:51+00:00 2026-05-15T18:25:51+00:00

I’m new to VBscript so there is probably a very simple solution to this.

  • 0

I’m new to VBscript so there is probably a very simple solution to this.

Basically, I have my main page with buttons that really just act as links to other pages. In the links I wanted to pass information, so I use the standard ?variable=value like so:

<input type="button" name="saveButton" value="Save Systems" onclick="location.href='save.html?step=1'" />
<input type="button" name="loadButton" value="Load Systems" onclick="location.href='load.html?step=1'" />

I looked up how to access GET variables in vbscript and every place I looked said to use Request.QueryString(“variableName”)

So in my save.html page I’m trying to first print the value of step, just to make sure I’m getting it, before I start actually handling all my code. This is where I’m hung up.

<script type="text/vbscript">
        document.write("<p>in the script<br>")
        document.write("stepVar = ")
        stepVar = Request.QueryString("step")
        document.write(stepVar)
        document.write(stepVar & "</p>")
</script>

... (rest of the page)

(I tried 2 different print statements just in case I was concatenating incorrectly, but neither work.) When I click my save button on the main page, leading me to save.html?step=1, it prints

in the script
stepVar = 
(rest of the page)

So I guess step is coming back null? Is the reason this isn’t working because I didn’t submit my variable through a form? That shouldn’t have anything to do with it… right? Why am I not getting my variable / how can I get the value of “step” so that I can take different actions depending on the value of my variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:25:52+00:00Added an answer on May 15, 2026 at 6:25 pm

    Had to write a function to parse the URL. Seen several of these in javascript, but the only one I found written in VBScript didn’t use regular expressions and DIDN’T WORK. After getting sick of trying to get the function to compile, and then to spit out an answer, I decided to write my own function using regular expressions, much like the javascript functions I’d seen (including the ones linked to in the other responses to this question).

    So that no one ever has to do this again:

    Function GetParameterFromURI(sVarName)
    
        Dim oTempParamCollection, I, sTempString, sURI_Query
        sURI_Query = window.location.search
    
        Set myRegExp = New RegExp
        myRegExp.IgnoreCase = False
        myRegExp.Global = False
        myRegExp.Pattern = "(\?|&)" & sVarName & "=[a-zA-Z0-9]+"
    
        Set matchCollection = myRegExp.Execute(sURI_Query)
    
        Set match = matchCollection.Item(0)
    
        returnString = Mid(match.value, InStr(match.value, "=")+1, len(match.value))
    
        GetParameterFromURI = returnString
    
    End Function
    

    If you use Option Explicit you will have to make sure everything is Dim’d before this will work. I didn’t bother.

    I encourage reposting of this code if anyone else is in need of this functionality; I’m frustrated that something so simple caused me so much grief and wouldn’t wish it on anyone else!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.