Very useful php function to prevent SQL injection_PHP tutorial

WBOY
Release: 2016-07-13 17:40:26
Original
881 people have browsed it

Very useful sql injection function


function inject_check($sql_str) {
return eregi(select| insert|update|delete||/*|*|../|./|union|into|load_file
|outfile, $sql_str); // Filter
> $check=eregi(select|insert|update|delete||/*|*|../|./|union|into|load_file|outfile, $sql_str); // Filter
if($check){
echo "Enter illegal injection content!";

exit();
}else{
return $sql_str;
}
}
PHP built-in functions can be used addslashes() implements the same function as the above function.

http://www.bkjia.com/PHPjc/486218.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/486218.html
TechArticle

Very useful sql injection function?php function inject_check($sql_str) { return eregi(select|insert|update |delete||/*|*|../|./|union|into|load_file |outfile, $sql_str); // Filter}...

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!