How to hide URL parameter passing in a dynamic webpage

Source: Internet
Author: User

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.

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.