prasadc Posted April 4, 2007 Share Posted April 4, 2007 hi all.. i am developing a forum, while posting a topic or reply...how can i disable the HTML tags and PHP scripting in those fields..?? and anyone pls tell me how can i manage smilies also.. iam screwd up for smtimes and any help is appreciated.. TIA Link to comment https://forums.phpfreaks.com/topic/45523-todisable-markup-and-php-scripting-in-text-inputs/ Share on other sites More sharing options...
joquius Posted April 4, 2007 Share Posted April 4, 2007 $text = htmlspecialchars ($text); or $text = str_replace (">", ">", $text); $text = str_replace ("<", "<", $text); and smilies, stuff like: $array = array ("/\: )/", "/\: P/"); $array2 = array ("<img src='smile.jpg' alt='' />", "<img src='blah.jpg' alt='' />"); $text = preg_replace ($array, $array2, $text); Link to comment https://forums.phpfreaks.com/topic/45523-todisable-markup-and-php-scripting-in-text-inputs/#findComment-221030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.