Home  >  Article  >  Backend Development  >  How to fix the problem that the $_SERVER variable is no longer protected by magic_quotes_gpc under PHP5_PHP Tutorial

How to fix the problem that the $_SERVER variable is no longer protected by magic_quotes_gpc under PHP5_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:15:15847browse

Copy code The code is as follows:

$magic_quotes_gpc = get_magic_quotes_gpc();
@ extract(daddslashes($_COOKIE));
@extract(daddslashes($_POST));
@extract(daddslashes($_GET));
if(!$magic_quotes_gpc) {
$_FILES = daddslashes($_FILES);
}

daddslashes function
Copy code The code is as follows:

//Translation character function
function daddslashes($string) {
if(!is_array($string)) return addslashes($string);
foreach($string as $key => ; $val) $string[$key] = daddslashes($val);
return $string;
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326172.htmlTechArticleCopy the code as follows: ?php $magic_quotes_gpc = get_magic_quotes_gpc(); @extract(daddslashes($_COOKIE)); @extract(daddslashes($_POST)); @extract(daddslashes($_GET)); if(!$magic...
Statement:
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