Is it possible to turn off magic quotes without an .htaccess or a php.ini file?
-
11-02-2021 - |
Question
One of my clients is hosting their site on freeservers.com ( a host that should be avoided at all costs ).
The host does not allow .htaccess files, and has no editable php.ini file on the server to edit.
But it does have magic_quotes on. Which is destroying all my POST requests.
What options do I have to turn this off still?
Solution
Is it possible to turn off magic quotes without an .htaccess or a php.ini file?
No.
Which is destroying all my POST requests.
Not a big deal.
To loop over $_POST array and strip slashes is a function of scarcely 5 lines, even with recursion.
Or you can google for the magic quotes and get this ready, I believe. It was posted thousands times here already, you know.
OTHER TIPS
You can still turn off it in PHP script using ini_set
like this
ini_set('magic_quotes_gpc',"0");
But disabling or enabling magic quotes with ini_set in PHP 5.3.0 is Deprecated.
I've never used PHP before.. but I found that if I put a php.ini file in any directory where PHP is receiving a POST request.. and put this line in it.
magic_quotes_gpc = Off
Problem solved! No .htaccess and no root php.ini file..