php_begins Posted June 28, 2011 Share Posted June 28, 2011 Hi, I have trouble displaying form data. For example, if a user enters <html tag>HEllo</html tag> in the form field, I need to strip the tags and also render the html useless. Right now I do something like this, echo strip_tags($message); It removes the tags alright, but the html code is still functioning. how do i fix it so that it removes the tag and also makes the html tags non functional. Link to comment https://forums.phpfreaks.com/topic/240630-php-strip-tags-and-render-the-html-non-functional/ Share on other sites More sharing options...
fugix Posted June 28, 2011 Share Posted June 28, 2011 the html will be non-functional after they are placed into strip_tags() Are you saying that you dont want the text in between the tags to display at all? Link to comment https://forums.phpfreaks.com/topic/240630-php-strip-tags-and-render-the-html-non-functional/#findComment-1235947 Share on other sites More sharing options...
php_begins Posted June 28, 2011 Author Share Posted June 28, 2011 so sorry, i made some syntatic mistake. It works now. I thought I had to use other functions in addition to strip_tags.. Link to comment https://forums.phpfreaks.com/topic/240630-php-strip-tags-and-render-the-html-non-functional/#findComment-1235949 Share on other sites More sharing options...
fugix Posted June 28, 2011 Share Posted June 28, 2011 no, strip_tags strips the tags from a string a leaves a plain string...mark this topic as solved please Link to comment https://forums.phpfreaks.com/topic/240630-php-strip-tags-and-render-the-html-non-functional/#findComment-1235952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.