Home > Backend Development > PHP Tutorial > Recommended resources for PHP encryption technology video tutorials

Recommended resources for PHP encryption technology video tutorials

黄舟
Release: 2023-03-15 16:18:01
Original
1809 people have browsed it

Since the birth of the Internet, website security has always been with us. In particular, the security of website data is particularly important. As a mature programmer, the processing of website data is particularly important. Will introduce several common data processing methods, as well as several forms of data encryption!

Recommended resources for PHP encryption technology video tutorials

Course playback address: http://www.php.cn/course/394.html

The teacher’s teaching style:

The teacher’s lectures are simple, clear, layer-by-layer analysis, interlocking, rigorous argumentation, rigorous structure, and use the logical power of thinking to attract students’ attention Strength, use reason to control the classroom teaching process. The teaching skills are full of wit. Various teaching methods and techniques are readily available and can be used freely and appropriately without any trace of polishing.

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

URL encoding encryption technology

The two functions urlencode and urldecode are related. On the contrary, urlencode encodes and encrypts data, and urldecode encodes and decrypts data.

The specific content of the urlencode function is as follows:

string urlencode ( string $str )
str
Copy after login

The string to be encoded.

Return value:

Returns a string. All non-alphanumeric characters in this string except -_. will be replaced with a percent sign (%) followed by two tens Hexadecimal numbers, spaces are encoded as plus signs (+). This encoding is the same as the encoding method of WWW form POST data, and the same as the media type encoding method of application/x-www-form-urlencoded. For historical reasons, this encoding differs from the RFC3896 encoding (see rawurlencode()) in encoding spaces as plus signs (+).

The main functions of urlencode:

First, it is usually used to hide plain text data

<?PHP
$url = &#39;admin.php?act=zhongguo&tx=123&#39;;
echo urlencode($url);
?>
Copy after login
admin.php%3Fact%3Dzhongguo%26tx%3D123
?=> %3F
= => %3D
% => %25
& => %26
\ => %5C
Copy after login

urlencode() will encode the string, as for which characters it is used for Special encoding has been mentioned when introducing the urlencode function above.

Second, encode the data submitted for GET

Perhaps you have not encountered the following situation:

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

Seeing this, everyone may start to complain, Axi! What is the act of this thing, del or del&add? What to do? Here we can use URL encoding to deal with this problem. By encoding del&add, act can be equal to del&add,

<?php
$str = &#39;del&add&#39;;
$url = &#39;admin.php?act=&#39;.urlencode($str).&#39;&data=abcd&#39;;
echo $url;
?>
Copy after login
admin.php?act=del%26add&data=abcd
Copy after login

In this way, we can get the data we want to transmit, so we can divide It’s very clear

Then there is urldecode

string urldecode ( string $str )
Copy after login

Just decrypt the urlencode encoded data

There is also rawurlencode() and rawurldecode() function, they just have different character encoding results.

The string returned after the two of them are used. The sequence of percent signs (%) followed by two hexadecimal numbers in this string will be replaced with literal characters.

The above is the detailed content of Recommended resources for PHP encryption technology video tutorials. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template