I jst got this trick lst nyt
NOW LETS START
in your logout link put it lyk dz
NOW IN UR logout.php
NOW LETS START
in your logout link put it lyk dz
<?php
echo"<a href='logout.php?url=".$_SERVER[PHP_SELF]." '>Logout</a>";
?>
NOW IN UR logout.php
<?php
//assigning $_GET to variable
$url = $_GET[url];
//checkin if $_GET comes wit a link
if(isset($url))
{
session_destroy();
//afta destroyin d session, it redirects back to d link coming with $_GET
header('location: '.$url.'');
die();
}
//if $_GET does not cum wit a link
if(!$url)
{
session_destroy();
header('location: index.php');
die();
}
?>
No comments:
Post a Comment