Login Page Demo (Php,Mysql)

<b>Session.php</b>
-------------------------
<?php session_start(); ?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("test",$con);
$sql="select * from stud where username='".$_POST['txtuname']."'and password='".$_POST['txtpass']."'";
$nrow=mysql_query($sql);
$row=mysql_num_rows($nrow);
if($row>=1)
{
echo "User Login ";
echo $_SESSION['uname']=$_POST['txtuname'];
}
else
{
echo "User not Login";
echo $_SESSION['uname']="";
unset($_SESSION['uname']);
}


?>
<form method="post">
<table align="center" border="1">
<tr>     <td>Username:</td>     <td><input type="text" name="txtuname"></td> </tr>
<tr>     <td>Password</td>     <td><input type="password" name="txtpass"></td> </tr>
<tr>     <td><input type="submit" name="submit" value="Login"></td> </tr>
</table>
</form>
</body>
</html>
--------------------------------------------------
<b>test.php</b>
--------------------------------------------------
<?php session_start();
if(isset($_SESSION['uname']))
{
    echo $_SESSION['uname']."User login";
}
else
{
    echo "User not login";
    $_SESSION['uname'];
   
}

?>