I'm not sure what to do with sessions, but I usually use cookies to make sure a user is logged in. First you should connect to MySQL and select the db. Then you have to check the data that the user have entered. This is how I do that:
$sql = "SELECT * FROM users WHERE username='$_POST[username]' AND password='$_POST[password]'";
$result = mysql_query($sql);
$nums = mysql_num_rows($result);
if($nums != 1)
{
echo "You have entered an invalid username or password.";
}
else
{
setcookie("User","$_POST[username]",time()+3600);
# This cookie will expire in an hour.
header("Location: index.php");
}
Then you could create a file that called 'verify.php', and include this in every page (not every include!):
# It's important that this code is put at the absolute top of the page!
if(isset($_COOKIE['User']))
{
echo "Welcome, $_COOKIE[user]";
}
else
{
header("Location: login.php");
}