Should at least start you off -
http://php.net/manual/en/security.php
http://www.w3schools.com/php/php_ref_filter.asp
http://www.phpro.org/tutorials/PHP-Security.html
http://www.webcheatsheet.com/php/regular_expressions.php
Also look up getimagesize() , mysql_real_escape_string () , htmlspecialchars () , htmlentities ().
As I said should start you off.You would obviously need to do more reading, however it's not as hard to secure a ready made page as people make it out to be.
To look up any one function just put php.net/functionnamehere and it should pop up. Just so you don't waste time looking over random stuff. ;)