Saturday, January 19, 2019

Why isn't disabling magic quotes in php.ini taking effect?



I disabled magic quotes at the end of my php.ini in my root directory and there was no change. Still getting backslashes in front of single quotes in $_POST entries. So I put a php.ini in the same directory as the php file being run and only included the lines disabling magic quotes. Still no change.



What am I missing here?




PHP 5.3.24 on GoDaddy Shared Server



php.ini file:



magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

Answer



You could try it with a .htaccess file, you will need this line:




php_flag magic_quotes_gpc Off


See also the php manual for this: http://php.net/manual/en/security.magicquotes.disabling.php



Edit



As GoDaddy Shared Server doesn't accept this above option try this instead:




You have to make a file named like php5.ini and place this in the root folder. You can add just only the three lines you need or you can copy the php.ini file that you have on your local computer and edit the changes you want.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...