1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is it safe to turn off magic quotes if all data is escaped?

Discussion in 'PHP' started by Silver89, Dec 17, 2011.

  1. #1
    This question is something simple that's bugged me for a few years now, not sure why just never really looked into fixing it and it's been a present issue on the site.

    At the moment I have magic quotes on and escape all input data that is used in queries with mysql_real_escape_string.

    In my scenario is it safe for me to turn off magic quotes?

    The site works fine at the moment but sometimes user's comment will have /' for example and it doesn't look very professional.
     
    Solved! View solution.
    Silver89, Dec 17, 2011 IP
  2. #2
    Yes, that should be done asap as magic quotes is no longer recommended, compared to mysql_real_escape_string() it misses some functionality.
     
    danx10, Dec 18, 2011 IP
  3. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #3
    Hi,
    I agree, if you escape data in your php code, you can turn off magic quotes.
     
    MarPlo, Dec 24, 2011 IP
  4. Jaxo

    Jaxo Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Magic quotes is disabled by default in PHP 6, I believe. They're deprecated right now, though, which means that using them is not recommended.
     
    Jaxo, Dec 31, 2011 IP