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; }
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; }