User click on log in when user already logged in so should throw message. I am write some code for user login. But i want when user click on log in button every ,that time checks user already logged in or not . if user logged then throw the informative message and if not throws error. How i do this.. Please help me..
You can check value of field uid of global variable $user:

global $user;
Contains preferences and other account information for logged-in users. When a user is not logged-in, the $user-&gt;uid property is set to 0.

http://api.drupal.org/api/drupal/developer!globals.php/global/user