I have created a comment system where people comment on a topic. The comment is stored in a SQL database. Now, to avoid malicious links, or JS/HTML/PHP code to be inserted into the comment which could be executed.. How do I prevent this? Suppose the comment is a JS code.. Like
<script> document.DoSomething()</script>
How would I prevent this? Thanks.