problem with logout form

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Tue Dec 04, 2012 11:20 am

HI ,

I a facing a problem with my logout form after destroying a session my page is not redirected to login.php

please guys advice me what i am doing wrong in this .

Code: Select all

<?php

session_start();


if(isset($_SESSION['username']))
{

	session_destroy();
	header("location: login.php");
	
}

?>
 
Thanks In Advance

Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Thu Dec 06, 2012 10:39 am

I sort out my problem by changing the code...

Code: Select all

<?php

session_start();


if(isset($_SESSION['username']))
{

   session_destroy();
      
}
header('Location: login.php');
?>

Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Sat Dec 08, 2012 10:07 am

Hey Guys my problem is being solved

Thanks

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 3 guests