Hi
I’m trying to log out a user and then redirect them to the home page but the process of clearing the session seems to prevent the redirect. The code is below. Does anyone have a proper way of doing this as I’m sure I’m missing something really obvious.
[code=php]
<?
ob_start();
session_start();
session_unset();
session_destory();
function redirect($location) {
header(‘Location: ./’ . $location);
}
redirect(‘index.php’);
?>
<html>
<head>
<script type=”text/javascript”>
function redir() {
window.location = ‘index.php’;
}
</script>
</head>
<body onload=”redir();”>
<!– this bit in case the php fails! –>
<a href=”index.php”>Home</a>
</body>
</html>
Thanks.
PS, I’ve noticed after I posted this that I misspelt destroy – Oops.