how to use header function:
you could take only one location into that, so there is a mistake if you write the files comma separated.
make a page , where you print links to the areas..
At the very first lines you in the restricted pages, you need only this lines only:
<?
session_start(); // this is necessary to put! othervise there will no $_SESSION variable available at all.
if($_SESSION["signed_id"]=="")
header("Location: index.php?back_from_a_restricted_page=1");
?>
And don't put the username and password check part in the config.php
and this code is entered JUST in the form, where you ask the username and password:
<?php
/* $conn=mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("gadgets",$conn); */
session_start();
if($_POST["username"]=="user_name" AND $_POST["password"]=="password")
{
$_SESSION["signed_in"]=1;
header("Location: add_banner.php, control_panel.php");
}
else
{
print 'No match';
}
if($_GET["back_from_a_restricted_page"]==1)
print "To allow this page, you must logged in.";
?>