All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
active server pages, ASP, vbscript,tutorial, newbie, beginner, how, to, how to program, help
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 281,252. lines
 Jobs: 101. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login

NEW! LEARNING CENTER
Special educational offers, white papers, webcasts, podcasts

  NEW! Download Rational Performance Tester V8 (download now)
  NEW! Download Rational Functional Tester V8 (download now)
  NEW! Download Rational Service Tester for SOA Quality V8 (download now)
  NEW! Teleconference: Quality In Action - Using Rational Quality Manager with Functional, Performance and Web Service Testing Products (download now)
  NEW! Introducing IBM Rational AppScan Developer Edition – easing security testing by non-security professionals (download now)

 

 


Latest postings for ASP/ VbScript.
Web Online Examination
By Suhas Manjunath Kashyap on 11/7


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 

Back to Tutorial Index

Request Object (Part 1)
By Brad Hess (hessb@4aspdev.com)
Reprinted with permission from http://www.4aspdev.com



Goto Tutorial Page(  1  2  3  4  5  )

The request object has a lot of different collections, properties, and events methods. The outline is as follows:

  • Properties
    • TotalBytes

  • Collections
    • ClientCertificate
    • Cookies
    • Form
    • QueryString
    • ServerVariables

  • Methods
    • BinaryRead

The TotalBytes Property returns the total number of bytes that have been posted to the server. This value is read only. This is not used much however it does come in handy sometimes. 

The first too collections that we will look at are the Form and Querystring collections. These are the most commonly used in ASP although the others are very useful once you get the hang of things.

Both the Form and the QueryString collections are related to the <Form> tags in HTML. When using the form tag in HTML there is a property called method. Method has two values associated with it: GET and POST. When using the GET you need to retrieve the value sent from the form using the QueryString collection. When POST is used you need to use the Form collection. The QueryString collection however is very useful for a number of things other than just retrieving the form information. An example is if you look at the address of this page you will see default.asp?ID=8. The ?ID=8 is a querystring and it is used to retrieve the article you requested, but more on that later.

The Cookies collection is pretty straight forward. It allows you to get and set values for a cookie that is stored on the clients machine. Cookies are not evil as some people have said they are. They are an efficient and safe way for a web programmer to store information about a user. Lets say you wanted to allow the user to set the background color on your web page so that every time they come to the site they see their chosen colors. How would you know it was them and what their settings are. There are two ways:
1) Have them log in every time and then store their info in a database that you pull it from.
2) Store a cookie with this information in it on their machine.

The ClientCertificates Collection is very similar to the Cookies collection however it is used to gain information about the certificate that the user connected with. This is used in secure sites so I will not expand upon it very much here.

The ServerVariables collection is a very useful collection that allows you to gain access to a number of variables relating to the server and the request. The variables are sent to the server in the form of an HTTP header which is information hidden for the user. I will show you in the examples how to retreive these value and also put them to use.

The BinaryRead method allows you to read in binary format the information set to the server. This method is not used much unless you are dealing with uploading files. We will expand more on this later.


Back to Tutorial Index








 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2008 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.