Escape encoding such as URL parameter +,&,=,/

Source: Internet
Author: User

  URLs appear with A +, space,/,?,%,#,&,= and other special symbols, may not be able to get the correct parameter value on the server side.

Case:

<src= "barcode39.aspx?barcodevalue=http://www.baidu.com.cn:8066/order/ Inputtraininginfo_kcsj.aspx? trainid=1&trainmoney=900&t=2&w=500&h=500 "  ID=" imgewm "/>

What if we want the Barcodevalue parameter to be http://www.baidu.com.cn:8066/order/InputTrainingInfo_kcsj.aspx? Trainid=1&trainmoney=900,&t=2,&w=500,&h=500 we need to escape the equals sign, otherwise the server side will default to barcodevalue=http:// Www.baidu.com.cn:8066/order/InputTrainingInfo_kcsj.aspx?,TrainId=1,TrainMoney=900,&t=2,&w=500,&h= 500.

Special symbol escape codes are as follows:

Symbol URL brokered results Escape codes
+ The + sign in the URL denotes a space %2b
Space Spaces in the URL can be used with a + or code %20
/ Separating directories and subdirectories %2f
Separating the actual URLs and parameters %3f
% Specify special characters %25
# Represents a bookmark %23
& Delimiter between the parameters specified in the URL %26
= The value of the specified parameter in the URL

%3d



After escaping the code:

<src= "barcode39.aspx?barcodevalue=http://www.baidu.com.cn:8066/order/ Inputtraininginfo_kcsj.aspx? trainid%3d1%26trainmoney%3d900&t=2&w=500&h=500 "  ID=" imgewm "/>

Escape encoding such as URL parameter +,&,=,/

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.