In the php5 environment, our $_SERVER variable will no longer be protected by magic_quotes_gpc. As for how the program can strengthen its own security, below we summarize how to protect cookie, get, post, files data in php. Friends in need can refer to it.
代码如下 | 复制代码 |
$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
The code is as follows
|