Often what I find is a in a comments page people will strip_tags on a variable then send it straight to the database. This means that if a guy puts a link (<a href="#">naughty angels</a> you will still have that entry stored in the database. Here is a small php snippet to stop that from happening.
PHP Code:
<?php
$message = "What ever you want it to be.";//From a form, whatever.
$message1 = strip_tags($message);
if ((strlen($message)) > (strlen($message1))){
$error = true;
echo("No tags allowed, fool");
exit;
} else {
//proceed with database addition, or whatever
}
?>