Imad Posted March 10, 2008 Share Posted March 10, 2008 Hi guys, I'm trying to disallow html and php from form fields. So far I have this: if ($comment && preg_match('<iframe>', '</iframe>', '<frame>') { echo "$comment"; } It doesn't seem to work. Their has to be another trick instead of putting all the html tags in. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted March 10, 2008 Share Posted March 10, 2008 try htmlentities() Quote Link to comment Share on other sites More sharing options...
Imad Posted March 10, 2008 Author Share Posted March 10, 2008 Thanks, that worked. Quote Link to comment Share on other sites More sharing options...
dotBz Posted March 11, 2008 Share Posted March 11, 2008 what about strip_tags()? :-\ Quote Link to comment Share on other sites More sharing options...
Imad Posted March 11, 2008 Author Share Posted March 11, 2008 what about strip_tags()? :-\ Strip_tags allows you to select tags that can be used in forms. htmlentities() did what I needed. Thanks, Imad. Quote Link to comment 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.