19 basic skills in ASP scripting

Source: Internet
Author: User
ASP is a programming environment where HTML, scripting language, and components can be used together to create powerful Internet applications on the server. If you have created a site that contains HTML, scripting language, and components, you can add ASP program code to it. You can also use components to include some commercial logic rules. A component can be called by a script or other components. The following describes the basic skills for using the 19th ASP scripting language:

1. The current date and time command is

The following is a reference clip:
You can.
Each item request. From ("input "))
Repomse. Write item &"
"
Next
%>

You can also use "for each X in tewuest. From" to repeat the input values of all fields.

2. asp uses a built-in object-requect to obtain table (from) data input, which varies with get and post.

3. If you want to write the. dll file in VB or other languages, you must register the. dll file for ASP. Enter regsbr32 *. dll in DOS.

4. show five repeated sentences, and the font is getting bigger and bigger.

The following is a reference clip:

Color = #00 FFFF>
Quick ASP

5. Send a string to the client

Response. Write string

The following is a reference clip:
For example:

6. Link to the specified URL address

Response. Redirect URL
The following is a reference clip:
For example:

* If the content of this. asp file has been transferred to the user for disconnection, an error will occur when redirect is used.

7. Integration of other languages with ASP:
The following is a reference clip:
For example, good morning is displayed in the morning, and hello is displayed in the afternoon.
+ #12:00:00 am # And Time

8.

9. # include other files

  

Virtual refers to the virtual file address.

File represents the absolute file address.

For example:

The following is a reference clip:

It can also be nested layer by layer. In addition, # include cannot be included.

10. asp: Get post

1. Get: After the user adds data to the URL, the format is "? Field 1 = input data 1 & Field 2 = input data 2 &... ", and then send it to the server.

For example: actionwww.abc.com, the input data of the field name is Jack, and the data of the field age is 15.

Ii. Post: the client transmits HTTP data to the Server ASP:

Get: Use "input data = request. querystring (" field name ")" to retrieve the data appended to the URL.

Post: Use "input data = request. forml" (field name ")" to read HTTP information data fields.
The following is a reference clip:
* Request. querystring example
For example, <a Hery = "aspform. asp? Name = Jack & age = 15 ">
Follow this </a> <p> 〉
Name:
Name:

Features:
Cool!HandsomeWarmhearted


Content of asp1b. asp

Hi, your character is

  

11. Request. From

Syntax: request. From (name) [(INDEX) |. Count]

Name: field name

Index: when multiple values are input for the same field, index specifies the value to be read from the same field. The range is from 1 to request. From (name). Count.

Count: the request. From (name). Count shows the number of values entered in the Name field. If this name field is not found, count is 0.

For example:

The following is a reference clip:
"
Next
%>

If input1 has two values, it indicates which one to read if index is not used.

The following is a reference clip:
<%
For

Request. From (

12. How to obtain the client's TCP/IP Port:

For example, TCP/IP Port is

Use server_port to obtain the connection port information for receiving HTTP requests.

13. Use the HTTP header information of http_accept_language to obtain the language environment of the user.

The following example judges the language environment of the client and provides different pages.

The following is a reference clip:

  • Previous Article: Detailed description of meta tag parameters, content, format, and usage
  • Next article: ASP: prohibit external site submission form
  • 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.