kpetsche20 Posted July 16, 2008 Share Posted July 16, 2008 How do I make a textbox so no HTML code is allowed Link to comment https://forums.phpfreaks.com/topic/115010-how-do-i-make-a-textbox-not-allow-any-html-code/ Share on other sites More sharing options...
MadTechie Posted July 16, 2008 Share Posted July 16, 2008 when the form is submitted, use strip_tags() to remove html tags or even better use htmlentities() this will convert > to > etc thus making it view instead of parsa example <?php $str = "hello world, here is some <b>BOLD</b> text"; echo strip_tags($str); echo "<br>"; echo htmlentities($str); ?> Link to comment https://forums.phpfreaks.com/topic/115010-how-do-i-make-a-textbox-not-allow-any-html-code/#findComment-591502 Share on other sites More sharing options...
Xurion Posted July 16, 2008 Share Posted July 16, 2008 In answer to your question, there is no setting/attribute to set a field to no HTML. You should use the functions MadTechie provided. Link to comment https://forums.phpfreaks.com/topic/115010-how-do-i-make-a-textbox-not-allow-any-html-code/#findComment-591523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.