Hide parameters in a URL

Source: Internet
Author: User

How to hide url parameter passing in Dynamic Web pages

Transferred from: https://www.cnblogs.com/limeiky/p/6202358.html

When we are doing dynamic Web site will often pass parameters between the various pages, and the names and values of these parameters will be exposed in the URL address bar, on the one hand is not safe, on the other hand is not easy to collect search engines, and sometimes it may be because the parameters contain Chinese and some browsers will be wrong ( I found an error when using the Get method to pass Chinese parameters in the Firefox browser. So we need to hide the URL parameter delivery, the specific method, see the following specific description.

Hidden URL parameter passing, the idea is to use a form to pass parameters, the value of the parameter is placed in the form, and the form is hidden, and then use hyperlinks to contact the issue of single event, so that the parameters are sent to another page post.

(1) Example: HTML file is the page to pass the parameters, the specific code is as follows:

<form name= "Form1" method= "Post" action= "A.action" > <input type= "hidden" name= "data1" value= "http// Www.htmer.com "/> <input type=" hidden "name=" data2 "value=" one "/> </form> <a href=" javascript:void (0) "Onclick=" Form1.submit () ">htmer hidden URL parameter pass </a>

  

Description: A form named Htmer was created in the code above. Form submitted page is htmer.asp, this form has two hidden fields, named Data1 and Data2, our goal is to pass the values of these two hidden fields to the Htmer.asp page, the most critical code in the above code is the last line, the principle is to use hyperlinks to contact the submission of the single submit event.

(2) Example: The final code is as follows, hoping to help others a little.

<form name= "Form1" method= "Post" action= "A.action" > <input type= "hidden" name= "Submit" value= "1" > <inpu T type= "submit" name= "test" value = "Go" style= "Display:none" >  


In fact, after clicking the hyperlink, the action of clicking the button is triggered, and the button submits the form!

Transferred from: https://www.cnblogs.com/limeiky/p/6202358.html

When we are doing dynamic Web site will often pass parameters between the various pages, and the names and values of these parameters will be exposed in the URL address bar, on the one hand is not safe, on the other hand is not easy to collect search engines, and sometimes it may be because the parameters contain Chinese and some browsers will be wrong ( I found an error when using the Get method to pass Chinese parameters in the Firefox browser. So we need to hide the URL parameter delivery, the specific method, see the following specific description.

Hidden URL parameter passing, the idea is to use a form to pass parameters, the value of the parameter is placed in the form, and the form is hidden, and then use hyperlinks to contact the issue of single event, so that the parameters are sent to another page post.

(1) Example: HTML file is the page to pass the parameters, the specific code is as follows:

<form name= "Form1" method= "Post" action= "A.action" > <input type= "hidden" name= "data1" value= "http// Www.htmer.com "/> <input type=" hidden "name=" data2 "value=" one "/> </form> <a href=" javascript:void (0) "Onclick=" Form1.submit () ">htmer hidden URL parameter pass </a>

  

Description: A form named Htmer was created in the code above. Form submitted page is htmer.asp, this form has two hidden fields, named Data1 and Data2, our goal is to pass the values of these two hidden fields to the Htmer.asp page, the most critical code in the above code is the last line, the principle is to use hyperlinks to contact the submission of the single submit event.

(2) Example: The final code is as follows, hoping to help others a little.

<form name= "Form1" method= "Post" action= "A.action" > <input type= "hidden" name= "Submit" value= "1" > <inpu T type= "submit" name= "test" value = "Go" style= "Display:none" >  


In fact, after clicking the hyperlink, the action of clicking the button is triggered, and the button submits the form!

JavaScript: Hiding parameters in a URL

Transferred from: https://www.cnblogs.com/Cchblogs/p/6024012.html

<script type= "Text/javascript" >function submitForm (URL, data) {var eleform = Document.body.appendChild (  Document.createelement (' form '));  eleform.action = URL;    For (var property in data) {var hiddeninput = document.createelement (' input ');    Hiddeninput.type = ' hidden ';    Hiddeninput.name = property;    Hiddeninput.value = Data[property];  Eleform.appendchild (Hiddeninput);  } this.eleform = Eleform;      if (!submitform._initialized) {submitForm.prototype.post = function ()  {This.eleForm.method = ' post ';    This.eleForm.submit ();  };  Submitform._initialized = true; }} function Onclick () {//location.href = "/activity/activityinformation?a_id=" + "1";//url with parameter new SubmitForm ('/acti Vity/activityinformation ', {a_id: "1"}). Post (); The parameters in the URL are hidden}</script>

  

Hide parameters in a URL

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.