Help with Logout button in PHP/HTML?

love is blind

New member
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:

<input type='button' value='Logout' onClick='admin_logout.php' class='button'>

admin_logout.php :

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

?>
I do create a session. Heres the code for the beginning of my admin_main:

<? session_start();
if(!isset($_SESSION['user_admin'])) {
header("Location: index.php");
exit();
}
include '../dbc.php';
$page_limit = 15;

if (!isset($_GET['page']) )
{ $start=0; } else
{ $start = ($_GET['page'] - 1) * $page_limit; }
 
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.
 
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.
 
Back
Top