1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[HELP!] PHP strange error (Apostrophe shows up with slash)

Discussion in 'BlackHat Lounge' started by farefis, Apr 1, 2010.

  1. farefis

    farefis Registered Member

    Joined:
    Jan 5, 2009
    Messages:
    76
    Likes Received:
    43
    Occupation:
    Internet Marketing
    Location:
    Phoenix, AZ
    Hey everybody. I've got a little problem and I was hoping that someone out there whose fluent in PHP could help. I run an article directory and every time someone posts a word with an apostrophe or a quote symbol it shows a slash right before it.

    Example: haven't shows haven\'t when it's posted

    This bug is driving me nuts! I believe it has to do with the "magic_quotes" but I'm not 100% sure. Anyone know why this is happening and how I can fix it? Ive search for two hours now for a solution. It seems to be a common problem with no answers.

    Thanks!
     
    Last edited: Apr 1, 2010
  2. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    http://www.tizag.com/phpT/php-magic-quotes.php

    Give that tutorial a go and see if it takes care of your problem, if not, let me know and I'll help you out further. It is a pretty simple correction. It definently is in your magic quotes functions.
     
    • Thanks Thanks x 1
  3. farefis

    farefis Registered Member

    Joined:
    Jan 5, 2009
    Messages:
    76
    Likes Received:
    43
    Occupation:
    Internet Marketing
    Location:
    Phoenix, AZ
    Haha go figure.. shorty after I make this post I figured it out. If anyone else comes across the same problem just access your .htaccess file in your root directory and add:

    php_flag magic_quotes_gpc off


    Thanks anyways BHW!
     
  4. farefis

    farefis Registered Member

    Joined:
    Jan 5, 2009
    Messages:
    76
    Likes Received:
    43
    Occupation:
    Internet Marketing
    Location:
    Phoenix, AZ
    Thanks for the help anyways aftershock. Thanks given for taking the time out of your day to help.
     
  5. kaidoristm

    kaidoristm BANNED BANNED

    Joined:
    Feb 13, 2009
    Messages:
    564
    Likes Received:
    727
    It can be magic quotes or addslashes not really a bug more like security option. Looks like before output slashes are not removed that's all.
     
  6. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    Cool, glad you got it taken care of.
     
  7. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    Glad to do it when I'm able. Just glad you got it working.
     
  8. The Scarlet Pimp

    The Scarlet Pimp Senior Member

    Joined:
    Apr 2, 2008
    Messages:
    883
    Likes Received:
    3,320
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    i had that prob last year...