- PHP: Select all
<?
session_start();
session_destroy();
header ("Location: http://www.qwhosting.co.uk/?logout");
?>
You should never link to the name of the index page (index.
html or index.
php) you should only link to the root (just a /)/
And this part:
- PHP: Select all
Welcome <? echo $_SESSION['username']; ?>
If (isset($_GET['logout'])) {echo "You have logged out";}
Change to :
- PHP: Select all
<?php if (isset($_SESSION['username'])) {
echo "welcome ".$_SESSION['username'];
}
if (iiset($_GET['logout'])) {
echo "you have logged out";
}
?>