Page 1 of 1

Values being automatically escaped

Posted: Thu Nov 15, 2007 9:11 am
by Echilon
I have a local srver set up for testing, and I'm experiencing a strange problem. When I type inputs into a form, PHP is reading them and escaping some values. I need to take what the user enters and sanitize it using my own methods, but something happening before I can get hold of it. I also have an account on Dreamhost, and when I try the script there it works fine. I've grabbed Dreamhost's php.ini and compared it to mine, and everything looks to be the same.

When I enter "'@\/#, then echo it using $_POST['input1'], I get \"\'@\\/#:. I thought it might have something to do with magic quotes at first, but this happens whether they're on or off. Does anyone have any idea what could cause this? I'm running Apache with PHP 5.2.5.

Thanks

Posted: Thu Nov 15, 2007 10:24 am
by pickle
Have you looked into the get_magic_quotes_gpc() and get_magic_quotes_runtime() functions?

Posted: Thu Nov 15, 2007 11:15 am
by Echilon
Thanks. It turns out XAMPP has two php.inis, I turned magic quotes off in both and it appears to be working.

Posted: Thu Nov 15, 2007 11:28 am
by John Cartwright
When in doubt use phpinfo() to quickly check the location of your php.ini ;)