dreamwest Posted February 15, 2009 Share Posted February 15, 2009 I have a search function that allows tags to be searched "<" and ">" etc Ive been using str_replace(): $search=$_REQUEST['search']; $search=str_replace("\'","'",$search); $search=str_replace("\"",""",$search); Is there a function to make all tags safe for form searches Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/ Share on other sites More sharing options...
genericnumber1 Posted February 15, 2009 Share Posted February 15, 2009 What do you mean? what are you doing with $search? Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/#findComment-762646 Share on other sites More sharing options...
Robbo_89 Posted February 15, 2009 Share Posted February 15, 2009 htmlspecialchars() ? Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/#findComment-762647 Share on other sites More sharing options...
dreamwest Posted February 15, 2009 Author Share Posted February 15, 2009 htmlspecialchars() ? Tried that but displays " instead of " Im outputing $search on the page Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/#findComment-762650 Share on other sites More sharing options...
Robbo_89 Posted February 15, 2009 Share Posted February 15, 2009 Try htmlspecialchars_decode() Not real sure what you want... Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/#findComment-762654 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.