Logout page
Posted: Thu Apr 12, 2007 6:03 pm
Hi there , i got this script that seems to work but only does half the job , can someone look it over and let me know why it is doing what it is doing
first of all , you click on the log out link, which brings you to this page , that asks you if you want to log out , yes or no,
you click on no it brings you back to the page you were at before, you click yes and it brings you back to the index.php logging you off,
this is what i need it to do ! it does it all, even logs the people out , but the problem is , right when you click on the initial link to get to the log out page, it logs you out, you dont even have to click on yes, so if someone clicks on the logout link from any other page lets say by mistake it logs you out! how do i stop it from logging you out right away and only log you out when you click yes?
any ideas?
Thank you
Elaine
Code: Select all
<?php
// This blurb starts the session for the users.
session_start();
header("Cache-control: private"); // Fix for ie6
?>
<?php include 'headermem.php'; ?>
<center><font color=white> Are you sure you want to logout?</font></center><br>
<center><a href=/index.php>Yes</a> | <?php unset($_SESSION['username']); session_destroy();
?>
<a href=javascript:history.back()>No</a>"; }
<?php include 'footermem.php'; ?>you click on no it brings you back to the page you were at before, you click yes and it brings you back to the index.php logging you off,
this is what i need it to do ! it does it all, even logs the people out , but the problem is , right when you click on the initial link to get to the log out page, it logs you out, you dont even have to click on yes, so if someone clicks on the logout link from any other page lets say by mistake it logs you out! how do i stop it from logging you out right away and only log you out when you click yes?
any ideas?
Thank you
Elaine