ASP tutorial three

xiaoxiao2021-03-06  14

Learning ASP, the most important thing is to master the six major objects built into the ASP. In fact, in the previous lecture, we have learned the response object (Is it? Have you made a mistake! See the object, method, attribute, collection, and events (you don't know!), If you haven't touched it before, you don't touch these concepts, know how to use it, my point is just starting The key is Linyi. Below we continue to learn the Request object through an instance, in order to deepen understanding, please run these programs to see the output results 1. Use the request.serVariables to get environment variables, this part is very simple, but the content is very important, how to get? Please see the case:

<% @ Language = vbscript%> <% 'wuf8.asp response.write "Run the path to the ASP file:" & _ request.servervariables ("script_name") & "
" response.write " Returns the data length of Content: "& _ Request.serverVariables (" Content_length ") &"
"Response.write" Returns the client's IP address: "Remote_Addr" & "
" Response. Write "Browser Name:" & _ Request.ServerVariables ("http_user_agent") & "
" response.write "Back to the home page actual physical path:" & _ request.servervariables ("Appl_Physical_Path") & "
"%>

Environment Variable Name / font>
Result1 result2

Now, you should discover how the routines in the previous lecture wuf2.asp is what Easy! Note: The HTML tag is purely prepared for the following example, so don't feel strange. So, what environment variables are there? If you run the following example, you will know (this program deletes some code, it is best to go to my site download source for easy understanding). <% @Language = VBScript%> <% 'wuf9.asp Option Explicit Dim SV%>

"response.write"
environment variable name Result <% for each sv in request.servervariables response.write "
"response.write sv response.write" "Response.write" "response.write request.servervariables (sv) response.write" "Next%>

The For ... EACH cycle is used here to list all the elements in a collection. If you don't understand the second half, please contact WUF8.ASP, then run the results, carefully experience (what attitude?).

Second, the data is transmitted by the table one-way server (it can also be understood, how the server is read how the client sends data) Do the home page, you should know that many homepages usually use the Form form to enable users to enter data, then pass "Submit) "Button sends data. "Method" in the FROM form has two main methods: post and get, and "action" is generally specified for a .cgi, .pl or .asp file, today we have to learn if you write this .asp file. (1) If the data is transmitted using the POST method, use the request.form to read the data. Edit the next WUF10.htm file for users to enter data:

Name:
Gender: