kpetsche20 Posted July 16, 2008 Share Posted July 16, 2008 How do I make a textbox so no HTML code is allowed Quote 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); ?> Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.