0

Possible Duplicate:
“slash before every quote” problem

I am using FPDF to generate pdfs for labels. On the labels they have inches (ie: " ). On localhost there was no problem, but now on my production server FPDF outputs a backslash before quotation marks in the produced PDF.

    4 1/2" gets transformed into: 4 1/2\"

Tried my google skills, but to no avail. Anybody know what's happening?

Community
  • 1
  • 1
cantaffordavan
  • 1,427
  • 4
  • 24
  • 44

1 Answers1

1

You can use get_magic_quotes_gpc to confirm if the values are being escaped or not during post:

PHP

if (get_magic_quotes_gpc()) {
    $myValue = stripslashes($_POST['myValue']);
}
else {
    $myValue = $_POST['myValue'];
}

This will return the value without slashes if the problem is being originated by the POST due to magic_quotes.

Since Magic Quotes are:

DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

Having you the localhost with 5.3.4, thus not using the Magic Quotes, probably the production server is using them, since the version specified is 5.2.17.

Zuul
  • 16,217
  • 6
  • 61
  • 88
  • It's so wierd because in my php config file (looking through WHM), it shows that magic quotes is disabled. But this worked! so I am happy. Thanks! – cantaffordavan Jun 11 '12 at 17:52