There are a couple of syntax errors. Properly formatting your code will help dramatically when trying to diagnose errors:
<?php
if(!isset($_SESSION['txt_username']) || !isset($_SESSION['txt_pwd'])){
//echo "<a href='login.php'>Log in</a>";
header("Location:login.php");
}else{
echo $_SESSION['txt_username'];
}