You just write small logic in one page called login_check.php...
and you must include that file in every page where ever you want security to your page:
like:
<? include("login_check.php"); ?>
In login_check.php:
<?
session_start();
if(empty($_SESSION['user_name']))
{
header('location:index.php');
}
?>