Very quick and dirty login, just add this entire script above the stuff in your index.php file.