<?php
ob_start();
session_start();
include "/config.php";
//include "filter.php";
include "adminfunctions.php";
//include "header.php";
//include "menu.php";
if(!isset($_SESSION['admin_login'])) {

//check the cookie
if(isset($_COOKIE['admin_login']) && isset($_COOKIE['password'])) {
//cookie found, is it really someone from the

$checkuser=check_db($_COOKIE['admin_login'],$_COOKIE['password']);  
if($checkuser);
$_SESSION['admin_login'] = $_COOKIE['username'];
header('Location: '.$_SERVER['REQUEST_URI']);
die();
}
else {

header ("location: login.php");
}
ob_flush();
}
?>