Docsity

Manipulating Request - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Manipulating Request - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Server-Side Web Programming

with Active Server Pages

ASP Intrinsic Objects

  • Request - Exposes what client sent to server. • Response - Collects output back to client.• Application - Represents the ASP page itself.• Session - represents a continuity of

connection.

  • Server - provides services to the application.• ObjectContext - For MTX and transactions.

Referencing Request.ServerVariables

  • Different syntax, same results: response.write

Request.ServerVariables("REMOTE_ADDR") response.write

Request.ServerVariables.Item("REMOTE_ADDR") Also response.write Request.ServerVariables(32) • But, index changes on different servers

Request.ServerVariables

  • Collection includes all HTTP headers sent

by the client using the following syntax: Request.ServerVariables("HTTP_

headername

"),

e.g.,Request.ServerVariables("HTTP_USER-AGENT")Request.ServerVariables("HTTP_REFERER") • Most examples show header names in all

caps, but actually is case insensitive.

  • Many of the variables available elsewhere.

Manipulating Request.ServerVariables

  • Count Property: Request.ServerVariables.Count • Use Count property to iterate through for i = 1 to Request.ServerVariables.Count

Response.Write I & ". " &Request.ServerVariables.Key(i) & ": "Response.Write Request.ServerVariables.Item(i) &"
" next

Commonly Used ServerVariables Request.ServerVariables("HTTP_REFERER") Page URL containing link used to get to this page. Request.ServerVariables("SERVER_NAME") Identify URL of local server for transportable scripts Request.ServerVariables("SCRIPT_NAME") Identify URL of ASP page for transportable scripts

Commonly Used ServerVariables Request.ServerVariables("HTTP_USER_AGENT") Identify client's browser - use to determine browser

capabilities without using BC component. Request.ServerVariables("HTTP_ACCEPT_LANG

UAGE") Determine language of client's browser -- use for

internationalization features.