check HTTP_HOST env var to determine if running on localhost - use appropriate db connection and urls
add close() calls after finished with db; add PasswordHash;
remove unnecessary/stupid close() calls; use phpass's CheckPassword method;