In my site's administration area, I have been using mysqli_real_escape_string when retrieving form input that goes into the database. It works fine but I realize that it does not prevent script injections. I mean I can pass through scripts like:
<script>alert('hello');</script>
What do I use in addition to this to prevent a malicious admin from injecting some nasty stuff?
htmlentities()
?strip_tags()
?htmlspecialchars()
?
What is the proper way to sanitize form input in back-end forms where html is not required for input data? I am confused?