Tip: here my table contains only Two Field user name and password, if ur table contains more that two fields you can also use *. There is no such issue of using (*) Specifically. (*) will select all the values from the database, where as I can also write

Note: Here first username you are watching is the name of the column in your database and the value $_POST[‘username’] is the value which we are getting from the form in the previous page. Similarly for password also.

Note2: md5($_POST[‘password’]) is the Password which is stored in the database in the form encrypted value, so that no one can see what the password is!!

Note: here we are giving username and password to a variable called $rowcount.

Next if the user name and password matches with the database we are assigning user a session. and If user name and password doesn’t matches with the database we are redirecting the user back to the login page, else we will redirect the user to its home page.