Magic Quotes....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
synical21
Forum Contributor
Posts: 150
Joined: Tue Jul 28, 2009 8:44 am
Location: London UK

Magic Quotes....

Post by synical21 »

Im pretty angry right now after a long battle talking to my hosting support about why they have magic quotes enabled. As probably predicted i got no where and they are not looking to change it in the near future... So i am here for some advice what to do, is their way to disable them with out access to php.ini? and when i use mysql real escape string the magic quotes are interfering i take it this is bad.

What do you recommend?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Magic Quotes....

Post by AbraCadaver »

If it is Apache and the company allows, you can add it to an .htaccess file in your site root dir:

Code: Select all

php_value magic_quotes_gpc 0
Last edited by AbraCadaver on Sun Dec 06, 2009 12:45 pm, edited 1 time in total.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
synical21
Forum Contributor
Posts: 150
Joined: Tue Jul 28, 2009 8:44 am
Location: London UK

Re: Magic Quotes....

Post by synical21 »

Nope i only got access to htdocs :( Any other walkarounds, i dont like slashes all over the place.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Magic Quotes....

Post by AbraCadaver »

Yeah, htdocs is your web root most likely. Try it.

-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
synical21
Forum Contributor
Posts: 150
Joined: Tue Jul 28, 2009 8:44 am
Location: London UK

Re: Magic Quotes....

Post by synical21 »

I opened notepad and typed in php_value magic_quotes_gpc 0 then saved it as .htaccess i then uploaded it to the directory and the server broke 8O

I got this error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Have i made the file correctly? I have never used a .htaccess before so hopefully i am doing it wrong.
Post Reply