* * *
ASP Quick Reference from . Print it out and put in your pocket for quick access.
* * *
## Basic Syntax
ASP scripts are surrounded by . Writing output to the browser:
The default language in ASP is VBScript. To use other scripting languages, insert a language declaration at the top of the ASP page:
## Forms and User Input
Request.QueryString is used to collect values from forms with method="get". Information transmitted from the form using the GET method is visible to all users (appears in the browser's address bar), and there is a limit on the amount of information that can be sent.
Request.Form is used to collect values from forms with method="post". Information transmitted from the form using the POST method is invisible to users, and there is no limit on the amount of information that can be sent.
## ASP Cookies
Cookies are commonly used to identify users. A cookie is a small file that the server leaves on the user's computer. Each time the same computer requests a page through a browser, it will send the cookie.
The Response.Cookies command is used to create cookies:
**Note:** The Response.Cookies command must appear before the tag!
The "Request.Cookies" command is used to retrieve cookie values:
## Including Files
By using the #include directive, you can insert the content of another ASP file into an ASP file before the server executes it. The #include directive is used to create functions, headers, footers, or elements that need to be reused across multiple pages.
Syntax:
or
Use the keyword virtual to indicate a path that starts from a virtual directory. If a file named "header.inc" is located in the virtual directory /html, the following line will insert the content of the "header.inc" file:
Use the keyword file to indicate a relative path. A relative path starts from the directory that contains the referenced file. If you have a file in the html directory and the "header.inc" file is in the html head, the following line will insert the "header.inc" file's content into your file:
Use the keyword file with syntax (..) to reference files in higher-level directories.
## Global.asa
The Global.asa file is an optional file that can contain declarations of objects, variables, and methods that are accessed by every page in the ASP application.
**Note:** The Global.asa file must be placed in the root directory of the ASP application, and each application can only have one Global.asa file.
The Global.asa file can only contain the following:
* Application events
* Session events
*