Uncovering the Mystery of ASP (2)

Source: Internet
Author: User
Tags array contains count http request string access port number root directory
Request Object

Author: Sage of the Rice Fairy

The request object is to get the data that the client browser sends to the server, which means you get information from visitors to your ASP. The Request object (requested object) contains five sets of form collections, QueryString sets, cookies collections, ServerVariables collections, and ClientCertificate collections.

1, Form
The form collection retrieves the values of the table elements that are sent to the body of the HTTP request by using the form of the POST method.
Syntax Request.Form (element) [(index) |. Count]
Parameters
element specifies the name of the table element to retrieve for the collection.
The index optional parameter, which you can use to access one of several values in a parameter. It can be 1 to request.form (parameter). Any integer between Count.
Number of elements in the Count collection
The Form collection is indexed by the name of the parameter in the body of the request. The value of Request.Form (element) is an array of all element values in the request body. by calling Request.Form (element). Count to determine the number of values in the parameter. If the parameter is not associated with more than one value, the count is 1. If the argument is not found, the count is 0. To reference a single value in a TABLE element that has multiple values, you must specify the index value. The index argument can be from 1 to Request.Form (element). Any number in Count. If you refer to one of several table parameters without specifying the index value, the returned data will be a comma-delimited string.

2, QueryString
The QueryString collection retrieves the value of a variable in an HTTP query string that is specified by the value of the question mark (?). You can also generate a query string by sending a table or by typing a query in the Address box of the user's browser.
Grammar
Request.QueryString (variable) [(index) |. Count]
The QueryString collection allows you to retrieve query_string variables by name. The value of the Request.QueryString (parameter) is an array of values that appear in all parameters in Query_string. by calling Request.QueryString (parameter). Count can determine how many values a parameter has.

3. Cookies
A Cookie is actually a tag, and when you visit a Web site that needs to uniquely identify your site, it leaves a mark on your hard drive, and the next time you visit the same site, the site's page looks for the tag. Each WEB site has its own tag, and the tagged content can be read at any time, but only by the page of that site. Cookies for each site exist within different files in the same folder as all other site cookies (you can find them in the Cookies folder in the Windows directory). A cookie is a token that uniquely identifies a customer, and a cookie can contain information that is shared by all pages of a WEB site between a conversation period or several conversations, and can be exchanged between pages using cookies. The collection of cookies provided by request allows the user to retrieve the value of the cookie sent in the HTTP request. This feature is often used in ASP programs that require authenticated user passwords as well as electronic bulletin boards, WEB chat rooms, and so on.
Grammar
Request.Cookies (cookie) [(key) |. Attribute
Parameters
The cookie specifies the cookie whose value you want to retrieve.
The key optional parameter that retrieves the value of the subkey from the cookie dictionary.
ATTRIBE specifies information about the cookie itself. such as: HasKeys Read Only, specifies whether the cookie contains keywords. You can access the child keywords of the cookie dictionary by including a key value. If key is not specified when accessing the cookie dictionary, all keywords are returned as a single query string. For example, if MyCookie has two keywords, first and second, and does not specify any of these keywords when calling Request.Cookies, the following string is returned.
First=firstkeyvalue&second=secondkeyvalue
If the client browser sends two cookies with the same name, then Request.cookie returns one of the deeper path structures. For example, if you have two cookies with the same name, but one of the path properties is/www/and the other is/www/home/, and the client browser sends two cookies to the/www/home/directory at the same time, Request.cookie will return only the second CO Okie
To determine whether a cookie is a cookie dictionary (whether a cookie has keywords), use the following script.
<%= request.cookies ("MyCookie"). HasKeys%>
If MyCookie is a cookie dictionary, the previous assignment is TRUE. Otherwise, FALSE.

4, ServerVariables
We all know that when browsing the Web page in the browser, the use of the transport Protocol is HTTP, in the HTTP header file will record some client information, such as: Customer's IP address, and so on, sometimes server-side needs to be based on different client information to make a different response, this time need to use ServerVariables collection to obtain the required information.
Grammar
Request.ServerVariables (server environment variable)


Server variable Purpose
All_http contains a complete list of nonstandard headers under the form Http_name:value
All_raw except when it was received there were no HTTP prefixes and other formats, and the others were the same as All_http
Apll_md_path contains a logical path to the database
Apll_physical_path contains a physical path to the database
Auth_password If the password you entered when you use the most basic authentication
Security authentication type used by Auth_type
AUTH_USER user name that has been authenticated
Cert_cookie contains unique identifiers for customer authentication
Cert_flags If a customer authentication exists, set the first flag bit, and if Certificate Authority trusted, set the second flag bit
Cert_issuer Customer certification and distribution agency
Cert_keysize the number of digits in SSL security code
Number of digits in SSL security code cert_secretkeysize in the server
Cert_serialnumber customer-certified serial number
Cert_server_issuer Certificate Authority for issuing server certification
Cert_server_subject Server-certified SUBJECT domain
Cert_subject customer-certified SUBJECT Domain
Content_length the number of bytes reported when a visitor makes a request to the server
Type of Content_Type request
The CGI version given in the form of the cgi/version, Gateway_interface
HTTPS contains the string on if it is a security request, otherwise contains the string off
Https_keysize the number of SSL bits used in the request
Https_secretkeysize the number of digits used on the server side
Https_server_issuer Server-certified Certificate Authority
Https_server_subject Server-certified SUBJECT domain
INSTANCE_ID The instance identification number of the Web server
Instance_meta_path the metabase path of the specific instance
IP address of the LOCAL_ADDR server
Logon_User If the user is logged on on the NT system, then the domain will contain the username
Path_info the path to the requested page outside the root directory of the domain name
Path_translated the physical path of the request
Query_string any data submitted by using the Get method, or after a question mark in a link
REMOTE_ADDR the IP address of the machine that made the request
Remote_host if present, for the requester's conversion name, otherwise, for the domain containing this IP address
Remote_user the user name sent by the visitor
Request_method use of the request method, that is, post or get
Script_name the virtual file location of the requested script
Server_Name Server host Name
Server_port the port number used to send the request
Server_port_secure if the request was sent over a secure connection, then the domain contains a value of 1, otherwise it contains 0
The version number of the protocol used by Server_protocol, that is, HTTP/11
SERVE



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.