Forum Moderators: coopster
I've put this code in which strips out ' but not % for some reason...
//stripslashes function
$searchtext = stripslashes($searchtext) ;
// don't let em put in nasty tings
$nastytings = array("%","'");
$searchtext = str_replace($nastytings,"",$searchtext); Can anyone tell me
a)how I can make this work for %
b)why some characters cause problems and some don't
c)is there a php function to do this a whole lot simpler
Thanks,
Helen.
htmlentities() [php.net]
and
htmlspecialchars() [php.net]