current location:Home>download site>Library download>Data validation library>PHP parameter filtering, data filtering class
PHP parameter filtering, data filtering class
Classify:Library download/Data validation library | Release time: 2017-03-17 | visits: 4149 |
Download: 178 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1A practical way to test HTML and CSS in real-time using only CSS.
- 2Django is for everyone.
- 3Sword and Expedition Start Pure Barbarian Team Lineup Introduction
- 4NBA Peak Showdown James lineup tactics coaching guide
- 5How to change the attributes of the exclusive magic weapon in the Book of Mountains and Seas: The Book of Strange Beasts. How to change the properties of the exclusive magic weapon in The Book of Mountains and Seas: The Book of Strange Beasts.
- 6NBA Peak Showdown Doncic’s Lineup Tactics Coach Recommends
- 7How to use the Essence of the Yuan Shen recorded in the Classic of Mountains and Seas: Strange Beasts. How to use the Essence of the Yuan Shen recorded in the Classic of Mountains and Seas: Strange Beasts.
- 8How to make wooden sticks in Jungle Hell. How to make wooden sticks in Green Hell mobile game.
- 9How to change the character of Call Me the Big Shopkeeper to a female character? How to change the character of Call Me the Big Shopkeeper?
- 10How to bandage wounds in Jungle Hell How to bandage wounds in Green Hell mobile game
- 11Durant’s lineup and tactics recommendations for NBA peak matchup
- 12How to make bone needles in Jungle Hell. How to make bone needles in Green Hell mobile game.
- 13How to log out if you call me the big shopkeeper? How to log off your account if you call me the big shopkeeper?
- 14Sharing of how to play the deck of Marvel's Ultimate Revival of Brother Su Rui
- 15How to check your own attributes when you call me the big shopkeeper? How to check the attributes of your close friends when you call me the big shopkeeper
Latest Tutorials
-
- Go language practical GraphQL
- 1354 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 2753 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1268 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2117 2024-03-29
Introducing php parameter filtering and php data filtering, including the basic principles of php submitted data filtering, php simple data filtering
Basic principles of php submission data filtering
1) When submitting variables into the database, we must use addslashes() for filtering. For example, our injection problem can be solved with just one addslashes(). In fact, when it comes to variable values, the intval() function is also a good choice for filtering strings.
2) Enable magic_quotes_gpc and magic_quotes_runtime in php.ini. magic_quotes_gpc can change the quotation marks in get, post, and cookie into slashes. magic_quotes_runtime can play a formatting role in data entering and exiting the database. In fact, this parameter was very popular back in the old days when injection was crazy.
3) When using system functions, you must use escapeshellarg(), escapeshellcmd() parameters to filter, so that you can use system functions with confidence.
4) For cross-site, both parameters of strip_tags() and htmlspecialchars() are good. All tags with html and php submitted by users will be converted. For example, angle brackets "<" will be converted into harmless characters such as "<".
$new = htmlspecialchars("Test", ENT_QUOTES);
strip_tags($text,);
5) For the filtering of related functions, just like the previous include(), unlink, fopen(), etc., as long as you specify the variables you want to perform the operation or filter the related characters strictly