Question:
Help with Logout button in PHP/HTML?
love is blind
2009-11-11 09:30:21 UTC
I'm a newbie at PHP. Any help will be greatly appreciated! My logout button does not. I'm sure its an easy mistake..

In my admin_main.php I have this code:



admin_logout.php :

session_start();
/************ Delete the sessions****************/
unset($_SESSION['user_admin']);
session_destroy();
include "admin_main.php";
header("Location: index.php");

?>
Three answers:
Atif Majid
2009-11-12 04:14:08 UTC
First of all "onClick" is client side event. And it will not go to admin_logout.php. You should redirect it using JavaScript either.
?
2016-12-13 14:31:52 UTC
Html Logout Button
Bill
2009-11-11 09:37:13 UTC
Does your admin_main or index.php create a new session? How many Global vars are you using besides user_admin?



You also should kill the cookie on the user machine.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...