You could use say, javascript, but you cant really trust that.
An alternative is to use htmlentities(), htmlspecialchars() or strip_tags() before storing the data.
My objection to that would be that the data size would increase, and the data might be less flexible.