In the register page code put this:
PHP Code:
<?php
Session_start();
$_SESSION['username']=$username;
?>
Remember session_start will go at very top of the page.
Than in the users pages retreive it like:
PHP Code:
<?php
Session_start();
$username=$_SESSION['username'];
OR
$_SESSION['username'];
Now do some validation here like:
if (isset($_SESSION['username'])){
Allow user to enter}else{ header('Location:login.php')
}
?>
In every page u want the user to allow with login use session_start();
and their Session stored username that either he is logged in or not.
Hope this will help.
Bookmarks