Question

How do I change the property magic_quotes_gpc = On to magic_quotes_gpc = Off in the web.config file? It's a server with IIS, and I can not edit the PHP.ini.

I tried adding the below to the htaccess.txt file, but it doesn't work.

php_flag magic_quotes_gpc Off
php_value magic_quotes_gpc Off
Was it helpful?

Solution

This will also work (in PHP)

ini_set('magic_quotes_gpc', 'Off');

OTHER TIPS

Don't trust magic_quotes_gpc, magic quotes option was introduced to help protect developers from SQL injection attacks. It effectively executes addslashes() on all information received over GET, POST or COOKIE. Unfortunately this protection isn't perfect: there are a series of other characters that databases interpret as special not covered by this function. In addition, data not sent direct to databases must un-escaped before it can be used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top