Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

problem with logout form

General discussions related to php

Moderators: macek, egami, gesf

problem with logout form

Postby Gamers » 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

Re: problem with logout form

Postby Gamers » 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

Re: problem with logout form

Postby Gamers » Sat Dec 08, 2012 10:07 am

Hey Guys my problem is being solved

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


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.