Jump to content

[SOLVED] wrong include, session error maybe, its confusing...


jesushax

Recommended Posts

hi heres my codes

 

when a user has logged in the session "UserAccess" is set to 1 this is fine, but if you see where the includes are for admin_menu or user_menu, when im logged in i get the user_menu for some reason

now the userAccess session is already approved as 1 if it wasnt the access.inc code would of kicked the user out, i cant understand why the admin_menu is not getting displayed when it should be... :S

 

Any ideas?

 

Thanks

 

admin.php

<?php 
include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/connection.php'); 
session_start(); 
include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/access.inc'); 
include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/header.php');
?> 
Admin
<?php include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/footer.php'); ?>

access.inc

<?php
if ($_SESSION["UserAccess"] =! "1"){
header("Location: /new/admin/index.php?action=adminonly");
}
?>

header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Construction Works</title>
<link href="/new/includes/css/layout.css" rel="stylesheet" type="text/css" />
<link href="/new/includes/css/styles.css" rel="stylesheet" type="text/css" />
<script src="/new/includes/java/switch.js" type="text/javascript"></script>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/date.php'); ?>
</head>
<body>
<div id="container">
<div id="header">
<div id="header-left"></div>
<div id="header-right"></div>
<div id="header-content"><img src="/new/images/layout/header.png" alt="header"/></div>
</div>

<div id="content">
<div id="content-left">
<?php 
if (isset($_SESSION["UserAccess"])){
if ($_SESSION["UserAccess"] == "1")
{include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/nav/admin_menu.php');	
echo"yes";}
else
{include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/nav/user_menu.php');
echo"no 1";}
}
else
{ include($_SERVER['DOCUMENT_ROOT'] . '/new/includes/nav/user_menu.php'); 
echo"no 2";}
?>
</div>
<div id="content-top"></div>
<div id="content-right">
<div id="content-text">
<div class="bg">

 

<?php
if ($_SESSION["UserAccess"] =! "1"){
header("Location: /new/admin/index.php?action=adminonly");
}
?>

 

Should'nt that be

 

<?php
if ($_SESSION["UserAccess"] != "1"){
header("Location: /new/admin/index.php?action=adminonly");
}
?>

 

!= instead of =!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.