View Single Post
  #4 (permalink)  
Old Nov 18th, 2007, 21:56
alexgeek's Avatar
alexgeek alexgeek is online now
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,800
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: PHP Logout Message when redirect

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";
}
?>
Reply With Quote