Page 1 of 1
Backslashes in my text...
Posted: Fri Jun 14, 2002 2:04 pm
by Jim
http://www.aoe2.com/!scripts/filesubmission/test.php
When I input text in that box with an apostrophe, it backslashes it. How do I fix that?
Thanks!
Re: Backslashes in my text...
Posted: Fri Jun 14, 2002 2:14 pm
by amnuts
Hi,
This is happening because your have magic_quotes on. You could turn this off in the php.ini file, but that's not always optimum. Instead what you could do is use a little function that checks for the magic_quotes and removes them (or adds them, of course) as needs be. The function to check for magic_quotes if get_magic_quotes_gpc().
Such as:
Code: Select all
function stripGPC($foo)
{
if (!get_magic_quotes_gpc()) return $foo;
else return stripslashes($foo);
}
I've put this kind of functions (which also works on any dimension array), along with a number of others in a class which can be found at:
http://andyc.users.phpclasses.org/brows ... e/1027.htm
Andy