Maybe I am just retarded and don't see the problem, so please take a look and let me know if I am missing something.
This is my index file, and then the include file (respectively):
<?php
$GLOBALS['SECURED'] = 1;
require('/www/includes/WCC_Main.php');
?>
<?php
session_start();
if (!empty($GLOBALS['SECURED'])) {
if (empty($_SESSION['LoggedIn'])) {
header("Location: http://www.wccompare.com/secured/login.php");
}
}
mysql_connect('localhost',,); //EDITED
mysql_select_db(); //EDITED
require('/www/includes/TT_Form.2004.09.06.01.php');
?>
The problem? It does not redirect to login.php. I am assuming, since $_SESSION['LoggedIn'] is not set, and therefore empty that the $GLOBALS['SECURED'] is the problem. But it is defined and right from the manual it says:
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward.
So someone, PLEASE let me know what I'm doing wrong because it should be there right?! 🙂
Thanks in advance!!!
Tom 🙂
P.S. register_globals is ON