Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Doesn't work with "quotes"' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Doesn't work with "quotes"
Authored by: discordantus on May 29, '03 06:41:38PM
actually, it will cause problems if magic quoting is off... it will eat any backslashes. The following code checks first to see if they are on or not:

if (get_magic_quotes_gpc()) {
	$q = utf8_decode(stripslashes($_GET['q']));
else
	$q = utf8_decode($_GET['q']);
if you ever distribute the script, it should check for magic quoting something like that.

[ Reply to This | # ]
Yes
Authored by: pbx on May 30, '03 10:00:06AM

You're correct -- when I said it was unlikely to cause problems I was referring to the fact that the backslash is not a meaningful character for most search engines. But your way (with proper bracketing of course) is safest.



[ Reply to This | # ]