umm basically i am trying to make it where if i set the site to close == 1 that it redirects the visitor to the closed page. though when i try the db is not picking up on the varibles. so i put in an if statement in the index.php
index.php
<?php
include( 'mysql.php' );
if ( $user['close'] == 1 ) {
header( 'location: closed.php' );
}
elseif ( $user['close'] == 0 ) {
include( 'index2.php' );
}
?>
than to tell the system what the varibles are i madse a new file called mysql.php
mysql.php
<?php
include( 'includes/inc-setup.php' );
$elcode = $db->fetch( $result );
$result = $db->query( "SELECT * FROM users WHERE uID=\"" . $elcode['uID'] . "\"" );
$user = $db->fetch( $result );
?>
the inc-config.php file hold my db connect info