haha ffanatics, just use a logout text link and direct it to the logout.php
or use a page function and just logout the user on the same page, you don't need to use a form to log a user out, you could build a class in your index.php, for the logout, with an if() statement to ensure it works
use the following link to function as logout:
CODE
//make sure the user exists
if($user){
echo "<a href=\"login.php?out=yes&user=$user\">Logout</a>";
}
then make the function "out"
CODE
$logout = $_GET['out']; // makes sure their logging out
$user = $_GET['user']; // gets the username
if ($logout == "yes") {
mysql_query("DELETE FROM active_users WHERE name='$user'"); // Logs them out
}
if you don't have an "active_users" field in your user table, you should add it, it makes life easier

Anyway, hope this helps
Comment/Reply (w/o sign-up)