login and crediting webapp in PHP