.htaccess - 当我无法访问php.ini时如何禁用magic_quotes

时间:2013-11-25 23:03:26

标签: php .htaccess magic-quotes-gpc

我想禁用页面上的魔术引号。我无法访问php.ini ... 当我尝试添加到我的.htaccess这一行时: php_flag magic_quotes_gpc off

我得到: 500内部服务器错误。在我的错误索引中,我发现了这个:

[Mon Nov 25 23:49:16 2013] [alert] [client MY_IP] /home/USER/public_html/.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration, referer: http://my-page.pl/index

我知道,我可以在'<之后添加此代码?PHP的':

if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach ($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}

但我不相信这个提示。你有什么想法吗?

0 个答案:

没有答案