Special character escape methods in url links

Source: Internet
Author: User
Special character escape methods in url links
This article describes how to escape special characters in a url link. learn how to escape characters. For more information, see.

Special characters in a url cannot be directly transmitted in a url for special purposes and must be url encoded.

The encoding format is % plus the characters' ascii code, that is, a percent sign %, followed by the corresponding characters' ascii (hexadecimal) code value. Special characters in the url must be escaped. 1. replace space with the plus sign (+). 2. separate directories and subdirectories with a forward slash (/). 3. question mark (?) Separate url and query 4. percent sign (%). Special characters 5 and # are specified. bookmarks 6 and & # are separated.

Url special symbols and the corresponding hexadecimal value encoding: 1. + the + sign in the url indicates space % 2b2. the space in the space url can be a plus sign (+) or encoded as % 203. /separate directories and subdirectories % 2f4 .? Separate the actual url and parameter % 3f5.% special character % 256. # indicates bookmarks % 237. & the delimiter % 268 between the parameters specified in the url. = the value of the specified parameter in the url % 3d

Functions for processing url escape characters in js such as escape, encodeuri, and encodeuricomponentphp filter parameters special characters prevent injection of php filter methods for illegal and special strings php instance: the example of a special character processing function replaces the php code of special characters in ultra-long text

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.