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 Quote 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? Quote 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() ? Quote 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 Quote 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... Quote Link to comment https://forums.phpfreaks.com/topic/145274-alternative-to-strip_tags/#findComment-762654 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.