So on my website I have a field for users where they can set a profile description of a max 100 letters. My problem is that they can use html for their profile description! I use a as input for their description and is put directly into the mysql database.
Here is the code for displaying their profile description
<div id="mid-profile-desc">
<p><?php echo $userProfileDesc;?></p>
</div>
<!--String is just this from database: $userProfileDesc = $row["profiledesc"];-->
But with this users when setting their profile description they can use languages such as html,css,javascript,php & a lot more. They can also control my database with that.
So how can I disable users from using all of those? I could probably just ban the "<" and ">" letters but that is probably not safe either. Any good ways of doing this with it being safe as well?