aliento Posted May 30, 2011 Share Posted May 30, 2011 I make a php application , it has a lot of forms. I want to avoid someones post like ?> or </html> . How can i make it. Quote Link to comment https://forums.phpfreaks.com/topic/237904-submit-forms-avoid-html-and-php-tags/ Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 strip_tags and htmlentities/htmlspecialchars Quote Link to comment https://forums.phpfreaks.com/topic/237904-submit-forms-avoid-html-and-php-tags/#findComment-1222514 Share on other sites More sharing options...
aliento Posted May 30, 2011 Author Share Posted May 30, 2011 Should i use and the 3 you mention ? Quote Link to comment https://forums.phpfreaks.com/topic/237904-submit-forms-avoid-html-and-php-tags/#findComment-1222519 Share on other sites More sharing options...
seanlim Posted May 30, 2011 Share Posted May 30, 2011 It depends on what you want to do. If you want to allow users to post tags, then don't use strip_tags which will remove tags. htmlentities and htmlspecialchars will simply convert some of those characters to their character entities, making them safe to print to your page Quote Link to comment https://forums.phpfreaks.com/topic/237904-submit-forms-avoid-html-and-php-tags/#findComment-1222522 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.