0
<?php
require_once('database.php');
require_once('upper.php');
$LoginId=$_COOKIE['LoginIdCookie'];
$query="SELECT * FROM registration WHERE LoginId='$LoginId'";
$result=mysqli_query($dbc,$query) or die('Not Connected');
$row=mysqli_fetch_array($result);
if(isset($_COOKIE['LoginIdCookie']))
{
setcookie('LoginIdCookie',$row['LoginId'],time()-3600);
echo 'Log';
}
else
{
setcookie('AdminCookie','A',time()-3600);
}

//$home_url='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/LoginValidator.php';
//header('Location: LoginValidator.php');
echo "You are logged out successfully.<br><br>";
echo $LoginId;
//echo "<a href='index1.php'>Back to Home</a>";
require_once('lower.php');
?>

HI friends.........
By above code I m not logged out even it displays "You are logged out successfully".....
After click on back button I can do everything.....
So plz tell me where I am wrong?????
Anyone plzzzzzzzzzz/////

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Shanti C
0

1.check whether control is going to if or else..Keep echos in two conditions.
2.Try to print

$row

value before if condition.
3.print cookie value after else..
4. also try this setcookie('LoginIdCookie',$LoginId,time()-3600);
5.for logout coding why you are checking the id with database(as it is already done in login code).

Edited by Shanti C: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.