Advanced ASP Programming (4): built-in object Request

Source: Internet
Author: User
System learning ASP begins with several built-in ASP objects.
Five objects: Request, Response, Server, Session, and Application
Let's take a look at the Request object today.
Of course, what has not been mentioned yet is what ASP is like? How do I know the code is ASP code?
When "<%" and "%>" are displayed, ASP is used, and ASP Source code is used between the two.
So why is the role of the object to be learned?
In fact, ASP provides these built-in objects that can be used in scripts, making it easier for users to collect information sent through browser requests, respond to browsers, and store user information, this frees object developers from a lot of tedious work.
The main function of the Request object is to receive and obtain information submitted or uploaded from the client browser on the server side. The Request object can access all information transmitted based on HTTP requests, including parameters and cookies transmitted from the Form using the POST method or GET method.
1. Request. form ("name ")
This is an acceptance method that is often used to accept information on the previous page. Request is an ASP object, and form is the set of objects contained in the Request object (the difference is different from the form in the HTML page ), name is the name of a text box, password box, or hidden field in the previous page form. It is also very important that the method for submitting the Form on the previous page must be the Post method.
Let's look at the two page programs below.
1. Test1.html (this page is HTML and mainly provides a platform for inputting information to submit the information to the next ASP page for processing)
<Form action = "submit1.asp" method = "post">
Your name: <input tpye = "text" name = "yourname"> <br>
Your pwd: <input type = "password" name = "yourpwd"> <br>
<Input type = "submit" value = "submit">
</Form>
[Ctrl + A Select All tips: You can modify some code and then press run]
Note that the method is post, and the submitted page action is submit1.asp.
2. Submit1.asp(asp page, and the following two values are accepted from test1.html: name = "yourname" and name = "yourpwd)
Your name is: <% = request. form ("yourname") %> <br>
Your pwd is: <% = request. form ("yourpwd") %>

When you debug HTTP pages through IIS, you will find two pages are associated: the name and pwd dynamically entered in test1.html, and the corresponding dynamic display is also performed in submit1.asp.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.