I stopped at #3...using stripslashes is not an acceptable deterrent by any means. I am also unsure how htmlentities has anything to do with SQL injection...maybe you meant XSS prevention? I chose not to read the rest.
Yeah, just logged in to say that. Author probably never heard of PDO and parametrized queries...
http://www.phptherightway.com/ http://fabien.potencier.org/php-is-much-better-than-you-thin...