It seems that SQL query which you are using is not proper as the variable pfno is not set before being passed into the query you can have a check over here
PHP Code:
username = $_POST['pfno'];
$password = $_POST['ledgerno'];
$result = mysql_query("Select * From user_table where pfno='$pfno'",$link);
According to me the SQL query should be as follows
PHP Code:
$result = mysql_query("Select * From user_table where pfno='$username'",$link);
If you want you can store many information in PHP session, if you authenticate the user you can store his name as well in the session too.
Bookmarks