Hi all,
I'm trying to validate input enter by users. I want to allow some html specifically <br> <p> <b> <u> <i> and <a>. I especially do NOT want to allow </form>.
Currently I have found this:
function escapeBadHTML($str)
{
$allowed = "br|b|i|p|u|a";
$str = preg_replace("/<((?!\/?($allowed)\b)[>]*)>\/xis", "<\1>", $str);
return $str;
}
I get the following error when I use this.
Warning: No ending delimiter '/' found in /usr1/home/gvaragas/public_html/send.php on line 48
If anyone can help with this or can come up with another way, I would greatly appreciate it.
Thanks.