Question

I disabled magic quotes at the end of my php.ini file in my root directory and there was no change. I am still getting backslashes in front of single quotes in $_POST entries. So I put a php.ini file in the same directory as the PHP file being run and only included the lines disabling magic quotes, but there still isn’t any change.

What am I missing here?

PHP 5.3.24 on a GoDaddy shared server.

The php.ini file:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Was it helpful?

Solution

Note: As of php 7.4 this option is deprecated and it is removed in php 8.0


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

php_flag magic_quotes_gpc Off

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.

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