1

I am working on a website and I have a php editor that automatically adds \ to certain things. I was aware of the stripslashes() function and I know it can be used in a way such as: stripslashes($test) but I am including something and I do not know how to strip the slashes from the Page I am including. Here is my include code that I am using:

<?php include $_SERVER['DOCUMENT_ROOT']."/newseditor/BlogTitle.php"; ?>

So how would I stripslashes from this? Thanks for reading and I appreciate all help I recieve.

NomadsBoy
  • 13
  • 2
  • 1
    It sounds like you need to disable MAGIC_QUOTES. – SLaks Jun 24 '13 at 23:52
  • See http://php.net/manual/en/security.magicquotes.whynot.php -- explains why you should *not* use MAGIC_QUOTES. – Amal Murali Jun 24 '13 at 23:57
  • Is there another way of doing that? – NomadsBoy Jun 24 '13 at 23:57
  • No, there isn't. Do the right thing, disable magic quotes, preferably via PHP ini settings, if not possible then you have to filter the input variables $_POST and $_GET (only if the option is set). See my answer. – Sven Jun 24 '13 at 23:58

1 Answers1

0

You are suffering from PHP's magic quotes, and here is how to turn it off:

http://www.php.net/manual/en/security.magicquotes.disabling.php

Sven
  • 69,403
  • 10
  • 107
  • 109
  • I get a 500 internal server error when disabling through .htaccess. – NomadsBoy Jun 25 '13 at 00:09
  • Talk to your hosting company to have the setting disabled. They probably have a FAQ for this common question. And .htaccess is not the only solution mentioned on the page. – Sven Jun 25 '13 at 00:10