Page 1 of 1

Filter input based on white list.

Posted: Fri Oct 07, 2011 3:14 pm
by TonsOfFun
Here is my situation,
I have a form input. I want people to be able to use some HTML tags, ie img, strong, h1, etc. but I want to filter out dangerous tags, ie script etc.
Basically I want people to be able to use certain tags that are not potentially harmful.

What is the best way to do this?

Thanks.

Re: Filter input based on white list.

Posted: Fri Oct 07, 2011 3:21 pm
by Celauran
strip_tags() will allow tags you specify and strip out the remainder.

Re: Filter input based on white list.

Posted: Sat Oct 08, 2011 11:11 am
by TonsOfFun
Perfect. Thank you.