Hey,
thanks, i did try that and it didnt work so i found that alternative in another post of your and i still couldnt get it to run correctly.
Forsome reason it will not function correctly...
The check login...
if($_POST['id'] == "login"){
if($_POST['password'] == "xxx"){
$_SESSION['admin'] = "admin";
$_SESSION['attemps'] = 5;
mysql_query("INSERT INTO login (sessid,ip)VALUES('$sessid','$ip')") or die(mysql_error());
header("location:index.php");
die();
}else{
if(empty($_SESSION['attemps'])){
$_SESSION['attemps'] = 5;
}
$_SESSION['attemps'] = $_SESSION['attemps'] - 1;
header("location:login.php?error=1");
die();
}
}
Confirm session id is in db, return the ip that is on the same row as the sessid.
Check the session exists and the sessid is the same as the current one, if not redirect..
if($ip != $login['ip'] && $_SESSION['admin'] != "admin"){
echo "Logged Out";
}else{
echo "Logged In";
}
If i empty the db it still shows as signed on even after a refresh??