jaymc Posted October 18, 2006 Share Posted October 18, 2006 Right, I have a PM system which allows members to send messages to each otherNow, when reading these messages I want to protect the script by disabling the processing of htmlSo, if a member types out a message like so "<b>hi</b> how are youThen hi will not be in bold, it will simply be displayed with those bold tags around it, the same as it works on hereHowever, and this is the tricky part, I want it to stop the processing of any HTML, apart from the <img> tags (for use with displaying emoticons in the message)Any feasable way to go about this? On the same note, I also want any PHP in messages to be displayed on page, not parsed or ignored Quote Link to comment https://forums.phpfreaks.com/topic/24318-stop-processing-html-apart-from-1-tag/ Share on other sites More sharing options...
xsist10 Posted October 18, 2006 Share Posted October 18, 2006 See [url=http://www.php.net/strip_tags]http://www.php.net/strip_tags[/url].[code]<?phpecho strip_tags($msg, "<img>");?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24318-stop-processing-html-apart-from-1-tag/#findComment-110601 Share on other sites More sharing options...
jaymc Posted October 18, 2006 Author Share Posted October 18, 2006 worked a treat, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/24318-stop-processing-html-apart-from-1-tag/#findComment-110605 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.