writing a new web site in php from scratch got the login to work and logout .
ive updated my script to insert the hidden session into the dabase no probs.
whats happening is even though when logout is clicked the session is terminated. but wont delete the record from the database
heres my code
<?php
include_once("inc/database.php");
include_once("inc/func.php");
session_name('website');
session_start();
$uid=$_SESSION['userid'];
$_SESSION=array();
$r=session_id();
$sql = "DELETE FROM online WHERE who='".$uid."'";
die(header("Location: /loggedout.php"));
?>
ive updated my script to insert the hidden session into the dabase no probs.
whats happening is even though when logout is clicked the session is terminated. but wont delete the record from the database
heres my code
<?php
include_once("inc/database.php");
include_once("inc/func.php");
session_name('website');
session_start();
$uid=$_SESSION['userid'];
$_SESSION=array();
$r=session_id();
$sql = "DELETE FROM online WHERE who='".$uid."'";
die(header("Location: /loggedout.php"));
?>
Comment