INT213Lab2

INT213Lab2 - INT213 Lab 2 (Rev 12/08) This lab will focus...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
INT213 – Lab 2 (Rev 12/08) This lab will focus on the ‘ Request ’ and ‘ Response ’ Objects. In your lecture regarding these topics, you saw how these two objects interacted with the server and the browser. The ‘Request’ gets information from the client and the ‘Response’ object returns information from the server. Request Object In a nutshell, the ‘Request’ object is used to retrieve data from the client. You have all used this object when you log into a web site, such as SIRIS. The data entered into TextBoxes, for example, is sent to the server where your script processes the data. Examples of the ‘Request’ objects collections are; Form collections and ServerVariables collection. VBScript already has some pre-defined Variables that are used by the Request Object. Let’s look at Server Variables ServerVariables - Examples When a browser sends data from a web page to a server, it also sends information about the client in the HTTP headers. Information such as the type of Browser, client IP address, etc. are passed to the server. Let’s try an example. Type the following into Notepad (save as INT213lab2a.asp ) as usual and run the script. <% Response.Write “ The server name is Response.Write “ The server software is Response.Write “ The server address is Response.Write “ The client address is Response.Write “ The file location is Response.Write “ The server protocol is %> What is your Server Name?____________127.0.0.1____________________________________________ What Server Software is being used?________microsoft-IIS/5.1_________________________________________ What is the client IP address?____________127.0.0.1___________________________________________ What server protocol is being used?_______HTTP/1.1___________________________________________ As you can see the information requested (and also sent to the server) can be useful if you need to find out something about the client. This information can be stored in variables and used for various reporting and programming purposes. Look at the above script again (which you saved as Lab2a.asp). Do you notice anything unusual about it? There is almost no HTML included in the ASP page. Everything being requested and processed by the server is in the script. VBScript will allow you to output information on the screen, without HTML, as long as you do not require any special formatting. In fact, you can write script that will contain no HTML at all. It is unusual to do so, but possible. Another interesting fact about Server-side script can be seen in the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/27/2011 for the course INT 213 taught by Professor Tim during the Fall '10 term at Seneca.

Page1 / 7

INT213Lab2 - INT213 Lab 2 (Rev 12/08) This lab will focus...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online