ASP depth revealed (on)

xiaoxiao2021-03-06  62

First, ASP basic knowledge 1. ASP is an abbreviation of Active Server Pages, which is an interpretation of scripting language environment; 2. ASP's run requires a Windows operating system, and PWS needs to be installed under 9x; and NT / 2000 / XP requires Internet Information Server (IIS); 3. The script tag of the ASP and JSP is "<%%>", and PHP can be set to a variety of; 4. The annotation symbol of the ASP is "'"; 5. Use additional components to extend the functionality of the ASP. Example: HelloWorld_1.asp <% = "Hello, World"%> Effect: Hello, World HelloWorld_2.asp <% for i = 1 to 10RESPONSE.WRITE "Hello, World" Next%> Effects: Hello, Worldhello, Worldhello, Worldhello , Worldhello, Worldhello, Worldhello, Worldhello, World Note: ASP is not case sensitive; variables can be used without definition, conversion is convenient; syntax check is very loose. Second, the use of an ASP built-in object: You can use any of the following ASP built-in objects without having to declare it in the ASP script. 1. Request: Definition: Available to access request information sent from the browser to the server, you can use this object to read the information that has entered the HTML form.

Set: cookies: Value for browser cookies: QueryString in the HTML table single domain: Values ​​containing query strings ServerVariables: The value of the first and environment variables: request_url.asp <% 'Get user input, and stored in the variable user_id = request.querystring ( "user_id") user_name = request.querystring ( "user_name") 'determines whether the user input the correct if user_id = "" thenresponse.write "user_id is null, please check it" response.endend ifif User_name = "" ThenResponse.write "User_name is null, please" response.Endendiff IT "Response.Write User_ID &"
"Response.write user_name%> Effect: When accessing http://10.1.43.238/ Course / request_url.asp? user_name = j: user_id is null, please check it When access http://10.1.43.238/course/request_url.asp?user_name=j&user_id=my_ID: my_idj Reflection: How variables are in URLs Is it acquired by the ASP page? Request_form.htm