Let me first tell you: NEVER give a password through a SESSION UNCODED. I also recommend you simply do the following:
- If a user has logged in (correctly) then a variable named $_SESSION is set "true" or "yes" and if it is needed in the rest of the pages, you also set a $_SESSION or a $_SESSION. If you still want to give a password through, please use md5(), sha1() or another encrypt function.
And at each page you do the following:
<?php
session_start();
?>
... other HTML
<body>
<?php
if ($_SESSION['auth'] == "yes") {
//
// You show the members only page
//
echo "You are now logged in and are able to see this!!!";
} else {
//
// You either show the login page or a link to the login page,
// example:
echo 'You are not logged in, please go to the <a href="login.php">login page</a>.';
}
?>
</body>
// Other HTML....
You can also put some javascript in it that redirects the user directly to the login page.
~G