I though this might be best for a forum so that anyone who wants to post any special html characters (&<>"') for legitimate reason, can do so.
The function that DRJ478 is also a good idea. I didn't even know that existed. You learn something new everyday
You want to strip the tags to keep users from posting HTML or malicious code.
Code:
</ta</table>ble>
will be stripped by strip_tags into
Code:
ble>
.
This means the tag is disabled even though there is a remnant of the nested tags.
Converting to htmspecialchars will display the tags in a kind of source code view and also disable them. If you state on your site that HTML will be disabled people who try to post HTML etc. will just have to reckon ugly looking posts.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.