If you have developed a website, you will surely know that when creating a dynamic website, we will often pass parameters between pages, and the names and values of these parameters will be exposed in the URL address bar, sometimes, the parameter name may be the name of a field in the database, which is insecure and not easy for search engines to include, sometimes some browsers may encounter errors because the parameters contain Chinese characters (I found that errors occur when passing Chinese parameters in the Firefox browser using the get method ). Therefore, it is necessary to hide the URL parameter transfer. For more information, see the following. Hide URL parameter transfer. My idea is to use a form to pass parameters, put the parameter values in the form, set the form to hidden, and then use hyperlinks to trigger form events, in this way, the parameters are passed to another page in post mode. (Some may not understand this. The following is a specific example)
For example, here we use ASPAS as an example to first create two web page files, respectively htmer.html and htmer. asp.
The htmer.html file is the page for passing parameters. The Code is as follows:
<Form name = "htmer" method = "Post" Action = "htmer. asp">
<Input type = "hidden" name = "data1" value = "http://www.htmer.com"/>
<Input type = "hidden" name = "data2" value = "htmer"/>
</Form>
<A href = "#" onclick = "htmer. Submit ()"> transfer hidden URL parameters by htmer </a>
Note: The above Code creates a form named htmer, and the page for form submission is htmer. ASP. There are two hidden fields in this form, named data1 and data2 respectively. Our purpose is to pass the values of these two hidden fields to htmer. on the ASP page, the most critical code in the above Code is the last line. The principle is to use hyperlinks to trigger the submit submission event of the form.
The htmer. asp file is the page for receiving parameters. The Code is as follows:
<%
Response. Write ("data1:" & request. Form ("data1 "))
Response. Write ("
")
Response. Write ("data2:" & request. Form ("data2 "))
%>
Note: The two parameters on the htmer.html page are displayed here. You can perform a test to see the results. Here is just a train of thought and can be used flexibly.