Resource recommendations for PHP encryption technology Video Tutorials

Source: Internet
Author: User
Tags form post urlencode alphanumeric characters
From the birth of the Internet, the security of the site has been accompanied by us, especially the security of the website data is particularly important, as a mature programmer on the site data processing is particularly important, <php encryption technology Video Tutorial > will introduce several common data processing methods, as well as several forms of encryption of the database!

Course Play Address: http://www.php.cn/course/394.html

The teacher's lecture style:

Teachers teach in a clear, well-organized, layered analysis, interlocking, rigorous argumentation, structural rigorous, with the logical power of thinking to attract students ' attention, with reason to control the course of classroom teaching. Teaching skills, full of wit, all kinds of teaching methods, skills, at ease, just right, and without the slightest trace of the carving.

The more difficult in this video should be: URL encoding encryption technology:

URL Encoding encryption technology

Urlencode,urldecode the two functions, UrlEncode encode and encrypt the data, UrlDecode encode and decrypt the data.

The functions of UrlEncode are as follows:

String UrlEncode (string $str) str

The string to encode.

return value:

Returns a string, in addition to-_, in this string. All non-alphanumeric characters are replaced with a percent sign (%) followed by a two-digit hexadecimal number, and a space is encoded as a plus (+). This encoding is the same as the WWW form POST data, and is encoded in the same way as the application/x-www-form-urlencoded media type. For historical reasons, this encoding differs from RFC3896 encoding (see Rawurlencode ()) in terms of encoding spaces as plus signs (+).

UrlEncode's main role:

A, usually used to hide the plaintext data

<? Php$url = ' admin.php?act=zhongguo&tx=123 '; Echo urlencode ($url);? >
Admin.php%3fact%3dzhongguo%26tx%3d123? =%3f= =%3d% =%25& =%26\ =%5c

UrlEncode () encodes a string, as to which characters are specifically encoded, as described above in the UrlEncode function.

Second, encode for get commit data

Perhaps we have not encountered the following situation:

Admin.php?act=del&add&data=abcd

See here, everybody may start to vomit the trough, Assi! What's this thing? Act is del or del&add. What to do, here we can use URL encoding to deal with this problem, to encode Del&add can make act can be equal to Del&add,

<?php$str = ' Del&add '; $url = ' admin.php?act= '. UrlEncode ($str). ' &DATA=ABCD '; echo $url;? >
Admin.php?act=del%26add&data=abcd

So we can get the data we want to transfer, so we can make it very clear.

And then there's urldecode.

String UrlDecode (String $str)

Just decrypting the UrlEncode encoded data.

There is also the Rawurlencode () and the Rawurldecode () function, which differ only in the result of character encoding.

They both use the returned string after the percent percent (%) in this string followed by a sequence of two hexadecimal digits will be replaced with a literal character.

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.