Search code examples
phpformsescapingapostrophe

How to stop PHP from escaping apostrophes in a form


I have a form, one input will contain the value: Where something = 'something'.

When I echo the $_GET (or $_POST) it replaces it with Where something = \'something\'

Any suggestions?

I thought it would be fixed with urlencode going into the form and urldecode when I echo it, but I can't figure out where I'm going wrong. Thanks!


Solution

  • You need to turn off magic quotes in php.ini.