allowing bb code but not java script
Posted
by
user1405062
on Stack Overflow
See other posts from Stack Overflow
or by user1405062
Published on 2012-06-10T16:22:53Z
Indexed on
2012/06/10
16:40 UTC
Read the original article
Hit count: 179
Hello im trying to get the hang of using bb codes onto my normal php site ( not forum or anything just a normal site )
I have seen a few posts like this one http://www.pixel2life.com/forums/index.php?/topic/10659-php-bbcode-parser/
which says i need a bb parser. I was just wondering can anyone show me how i would use one ?
I have a status box were users can update there status but i would like to allow bb codes but not java script.
So when im doing my inserting into the db i strip the status like so..
$status= mysql_real_escape_string($_POST['status']);
$status2= strip_tags($status);
And that stops the java script and tags from getting though but i need the bb code tags to come though but carry on blocking the java script code is there anyway to do this ?
Also then i just echo it out
echo $status2 ;
But just plain text shows so was just wondering if anyone knows how to let though bb code and stop java script and could some one show me how to use the bb parasher ? also need to know how to echo out the bb coding...
© Stack Overflow or respective owner