All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
request,object,many,different,collections,pro
   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!



 
 
   

The Request Object (Part 1 of 4)

Print
Email
 
article
Submitted on: 5/19/2000 12:13:00 PM
By: Brad Hess from http://www.4aspdev.com  
Level: Intermediate
User Rating: Unrated
Compatibility:ASP (Active Server Pages), VbScript (browser/client side)

Users have accessed this article 13083 times.
 
 
     The request object has many different collections, properties, and event methods which can get confusing. This handy 4 part tutorial guides you through them all, and even includes sample source code to get your started!<br> <a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6173">Part I</a>  <a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6174">Part II</a>  <a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6175">Part III</a>  <a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6176">Part IV</a>

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

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

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.



Other 13 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this article(in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/22/2000 2:06:51 PMabhijit

this article is a great primer for anyone who is new to asp.
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
To post feedback, first please login.


 

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.