try this:
save it as logout.php
PHP Code:
<? session_start() ?>
<HTML>
<HEAD>
<TITLE>Logout</TITLE>
</HEAD>
<BODY>
<H2>Logout</H2>
<?
// if the user is logged in, log them out
if ($logged_in_user) {
session_unregister("logged_in_user");
echo "You are now logged out.";
// if the user isnt logged in, let them know that
} else {
echo "You haven't logged in yet.";
}
?>
<BR>
<BR>
<A HREF="login.php">Click here to log in.</A>
<BR>
<BR>
<A HREF="register.php">Click here to register as a new user.</A>
</BODY>
</HTML>
Bookmarks