Home > Backend Development > PHP Tutorial > PHP anti-injection_PHP tutorial

PHP anti-injection_PHP tutorial

WBOY
Release: 2016-07-21 15:57:25
Original
947 people have browsed it

$_POST = sql_injection($_POST);
$_GET = sql_injection($_GET);

function sql_injection($content)
{
if (!get_magic_quotes_gpc()) {
if (is_array($content)) {
foreach ($content as $key=>$value) {
$content[$key] = addslashes($value);
}
} else {
addslashes($content);
}

return $content;
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/317793.htmlTechArticle$_POST=sql_injection($_POST); $_GET=sql_injection($_GET); functionsql_injection($content) { if(!get_magic_quotes_gpc()){ if(is_array($content)){ foreach($contentas$key=$value){ $con...
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