So I presume you want a user auth script? If you know how to insert users via a reg form then add this code to every page your want to protect:
// logged.php:
if(!@$_SESSION)
{
print "You must be logged in to view this page";
die();
}
session_start();
For setting sessions vars for the login:
// login.php
if($Submit == "Login")
{
$username = $_POST["username"];
session_start();
session_register("username");
header("location: logged.php");
}
I would recommend making a small script which checks if the user and pass exists by querying the database. You put an extra conditional before defining $username to check for user & pass existance.