Closed Thread
Results 1 to 6 of 6

Thread: Disable magic_quotes

  1. #1
    swedman is offline x10Hosting Member swedman is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    4

    Disable magic_quotes

    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.

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Disable magic_quotes

    You can use stripslashes() to get rid of the slashes.

  3. #3
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Disable magic_quotes

    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.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  4. #4
    swedman is offline x10Hosting Member swedman is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    4

    Re: Disable magic_quotes

    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)

  5. #5
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Disable magic_quotes

    Quote Originally Posted by swedman View Post
    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/securit....disabling.php

    Notice that magic quotes is deprecated and will be removed as of PHP 6
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  6. #6
    pythondev is offline x10Hosting Member pythondev is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    59

    Re: Disable magic_quotes

    James @ php.net was always a nut depreciating everythng LOL

    but as technology evolves, so must the software...

Closed Thread

Similar Threads

  1. Replies: 1
    Last Post: 02-24-2009, 04:42 PM
  2. Upload Skin tmfile() disable
    By supersonic in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 04-07-2008, 01:13 AM
  3. XP Default services, The ones you can get rid of
    By frznmnky in forum Tutorials
    Replies: 2
    Last Post: 01-21-2008, 11:09 AM
  4. Disable DHCP with DSL connections
    By frznmnky in forum Computers & Technology
    Replies: 2
    Last Post: 12-27-2007, 04:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers