Variables

If you know anything at all about programming then you know that variables, the little 'containers' in which you store numbers or text, are a vital component of any programming language. The VBscript in ASP pages handles variables well but with one great problem - the contents of variables are almost always lost when you move from page to page. 

There are, however, four ways to pass variables (or 'parameters') from page to page:

  • Via a 'query string', some text that is added to the URL of the requested page. Several of the demonstration pages here use this method.
  • Via 'posting' from a form.  Several of the demonstration pages here use this method. Note that a form can also be used to send data via the query string by using the GET method instead of the POST method.
  • Variables can be stored in a special file called the global.asa file. Since these variables are saved when the global.asa file is saved these variables become available to all future users of the script.
  • Variables can be saved in a 'cookie' file. Like variables saved in the global.asa file, cookie variables remain available indefinitely, but, unlike the global.asa variables, they are stored on the client computer rather than the server and may be accessible only to a specific user of the computer.