|
|
|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98
- PICSBy using the PICS property, you can control the rating values of the PICS-label field. The syntax for using the PICS property is
Response.PICS(PicsLabel)
where PicsLabel is the formatted PICS label.
- ContentTypeBy using the ContentType property, you can specify the MIME content type the Web server will send to the browser. The syntax for using the ContentType property is
Response.ContentType=[ContentType]
where ContentType is a valid content type. Examples of valid content types are image/GIF, image/JPEG, text/HTML, and so on.
- CharSetThe CharSet property controls the character set of the content type the browser will display. The syntax is
Response.CharSet(CharSetName)
where CharSetName is a valid character set name.
Methods The following methods are supported by the Response object:
- WriteBy using the Write method, you can send output to the client. The Write methods syntax is
Response.Write variant
where variant is a VBScript data type. You can use the following line of code, for example, to send the current date and time to the clients browser:
<%Response.Write now%>
- BinaryWriteBy using the BinaryWrite method, you can send binary information, such as an image, to the client. The BinaryWrite methods syntax is
Response.BinaryWrite binarydata
- RedirectRedirect is used to direct the client to a different URL. You will find the Redirect method useful if your sites URL has changed, but a visitor to your site has not updated its link to your site. This way, when the visitor connects to your site at the old URL, the Redirect method will automatically redirect the visitors browser to the new URL. The Redirect methods syntax is
Response.Redirect URL
You can use the following line of code, for example, to redirect the client browser to the default.asp Active Server Page on your server:
<%Response.Redirect default.asp%>
- AppendToLogBy using the AppendToLog method, you can record information within the Web servers log file. As a result, you can use the AppendToLog method and the log file for debugging and tracking purposes. The AppendToLog methods syntax is
Response.AppendToLog string
where string is the string you will record to the log file.
- AddHeaderAddHeader adds information to the existing HTTP header. The AddHeader methods syntax is
Response.AddHeader header_name, header_value
where header_name is the name of the header, and header_value is the headers value.
- ClearBy using the Clear method, you can direct the Web server to clear its buffer. The Clear methods syntax is
Response.Clear
- FlushThe Flush method directs the Web server to send the buffered output to the client browser. The Flush methods syntax is
Response.Flush
NOTE: You can use the Clear and Flush methods only if the buffering is on. If buffering is turned off, no data will be within the servers buffer. Using either method in such a case will result in an error.
- EndBy using the End method, you can control the amount of data within the Web servers buffer. The End methods syntax is
Response.End
When the server that processes the script comes across the End command, the server, in turn, will stop the data buffering.
The Request Object
The Request object enables you to retrieve information from the client. The Request object includes five collections:
- ClientCertificateBy referencing the ClientCertificate collection within the Request object, the Web server can collect information about certification fields from the browser. The certification fields include the following:
- CertificateThe Certificate field contains the entire certificate content in ASN.1 format.
- SerialNumberThe SerialNumber field contains the certification serial number.
- ValidFromThe ValidFrom field specifies when the certificate will come into effect.
- ValidUntilThe ValidUntil field specifies when the certificate will expire.
- IssuerThe Issuer field contains information about the issuer of the certificate.
- SubjectThe Subject field contains information about the subject of the certificate.
- CookiesBy using the Cookies collection within the Request object, the Web server can collect information from the cookies on the client machine. The syntax for using the Cookies collection is
Request.Cookies(cookie)[(key)|.attribute]
where cookie is the cookies name, key is the index of subkey values, and attribute is the specified cookies property.
- FormThe Form collection is extremely useful because it enables you to retrieve information the user enters on a form within the browser. The syntax for using the Form collection is
Request.Form(parameter)[(index)|.Count]
where parameter is the form collections name, index is the specific form element, and count is the number of elements on the form.
- QueryStringSometimes data is passed to the server on a URL. By using the QueryString collection, the Web server can parse the information contained with the URL string. The syntax for using the QueryString collection is
Request.QueryString(variable)[(index)|.Count]
where variable is the variables name within the query string, index is the element index, and count represents the total number of elements within the query string.
- ServerVariablesThe ServerVariables collection enables you to access values of server environment variables. The syntax for using the ServerVariables collection is
Request.ServerVariables (ServerVariable)
where ServerVariable is the server variables name. Table 33.4 lists the server variables.
|