Disable magic_quotes

Status
Not open for further replies.

swedman

New Member
Messages
4
Reaction score
0
Points
0
Hi, I am a pretty new user here with about a mount maybe time here, but I am already stuck.

I am currently developing a new site for my clan / group / community with PHP and so far I got a nice news system.

Now for my problem, since magic_quotes is on all my quotes looks like \" instead of " and at the beginning this wasn't a big problem, it only looked ugly. However now when I am finished with a new version I realized it is not compatible with magic_quotes at all.

As a extra info I can tell you that I use mysql_real_escape_string() on all fields where there is a user input.

I searched the forum and on all places it said that you had to apply for PHP v3 for magic_quotes to be disabled, but since applying for new versions has been disabled I really don't know what to do...

The "Upgrade PHP version" in cPanel:
This feature is not currently activated on your account. All accounts are set to x10Hosting's PHP v2. If you are not sure what that means, don't worry about it.
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
You can use stripslashes() to get rid of the slashes.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
magic quotes gpc is a system wide directive. It cannot be canceled at runtime, eg, in your script. lemon-tree's function is the best way to reverse this.
 

swedman

New Member
Messages
4
Reaction score
0
Points
0
I know you can do it that way but it would make my site a lot slower and would require me to rewrite a lot of code. I don't understand why it is not allowed to disable it with .htaccess because many web developers can create nice safe sites without magic quotes. (on the host I used before x10hosting they allowed that and that is where I run my site currently just because of this)
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I know you can do it that way but it would make my site a lot slower and would require me to rewrite a lot of code. I don't understand why it is not allowed to disable it with .htaccess because many web developers can create nice safe sites without magic quotes. (on the host I used before x10hosting they allowed that and that is where I run my site currently just because of this)

PHP does not allow this, not X10. It is actually impossible to disable magic quotes if it is installed into PHP. http://us3.php.net/manual/en/security.magicquotes.disabling.php

Notice that magic quotes is deprecated and will be removed as of PHP 6
 

pythondev

New Member
Messages
59
Reaction score
0
Points
0
James @ php.net was always a nut depreciating everythng LOL

but as technology evolves, so must the software...
 
Status
Not open for further replies.
Top