Jump to content

[SOLVED] logout button dosent work


dad00

Recommended Posts

you have two { {

 

if(isset($_SESSION['logged'])){           // number one here.
if(isset($_POST['logout'])){    // number two here.
	echo"<meta http-equiv='refresh' content='1' url='index.php'";
} // only one here
?>

 

but only one } in what yoiu posted??

just to be sure, do this:

 


PUT AT TOP OF PAGE.

$a = $_GET['a'];

if($a == "logout"){
session_destroy();
header("location:index.php");
}


LINK FOR HTML:

<a href="?a=logout">logout</a>

 

Make sure the sesion is being destroyed in your code. If so, then it is the actual meta refresh. If you put the above right at the top of your page, there is no need to refresh.

 

Hope that helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.