this is my login code....!

this working for login....

once iím logid in... it will redirect tooo dash.php page.. that 1 is my home page... in this page login information is not shown...!

based on this session and details... how to continue this session to all pages...

username: un
table name: emp_table
name: nm
email: eml

this is login.php



<?php
session_start();
extract($_POST);
extract($_GET);
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("shift_planning") or die(mysql_error());



function validate_user($un, $pw){
$select_query = "Select * from emp_table where un='".$un."' and pw='".$pw."'";
$select_result = mysql_query($select_query);
return $select_result;
}

if(isset($_POST['login_submit'])){



$validate_result = validate_user($un, $pw);



if(mysql_num_rows($validate_result) != 0)
{
$user_result = mysql_fetch_array($validate_result);
$_SESSION['logged_user'] = $user_result['un'];

echo "<meta http-equiv=\"refresh\" content=\"0;URL=dash.php\">";
}
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;URL=login.php\">";
echo "<script>alert('Login Failed! Please Enter Valid Username and Password.')</script>";
}
}



?>






and this one is. for session continue code... but not working...




<?php
function get_user_info_by_id($id){
$select_query = "Select * from emp_table where un=$un";
$select_result = mysql_query($select_query);
$result = "";

if (mysql_num_rows($select_result) != 0) {
return $select_result;
}else{
return $result;
}
}
?>
<?php

if(isset($_SESSION['logged_user'])) {
$user_res = get_user_info_by_id($_SESSION['logged_user']);
$user_info = mysql_fetch_array($user_res);

?>
<a href=""><?php echo ucwords($user_info['nm'])." ". ucwords($user_info['un']); ?>

<?php } else { ?>

<a href="index.php" class="signin">Login</a>


<?php } ?>


please help me