Sure. I'll keep whats relevant.
management.php
<?php
session_start();
if (!isset($_SESSION['username']) || !isset($_SESSION['pass']) || !isset($_SESSION['access'])) {
header("Location: [url]http://papoukewis.onondaga36.org/login.php[/url]");
exit;
}
if ($_SESSION['access'] != "3") {
header("Location: [url]http://papoukewis.onondaga36.org/index.php[/url]");
exit;
}
include('./includes/header.tpl');
include('./includes/navigation.tpl');
$mode = $_GET['mode'];
$username = $_POST['username'];
$userid = $_GET['id'];
$password = $_POST['password'];
$cpassword = $_POST['cpassword'];
$email = $_POST['email'];
$access = $_POST['access'];
switch($mode) {
case 0:
include('./includes/management.tpl');
break;
management.tpl
<td class="body">
<p class="newshead">Admin Management</p>
<table class="nested">
<?php
include('./mysql.php');
$place = @mysql_query("SELECT * FROM admins ORDER BY id DESC") or die("Couldn't Query: " . mysql_error());
$num = @mysql_num_rows($place) or die("Failed Numbering Rows: " . mysql_error());
for ($i = 0;$i < $num;$i++) {
$row = @mysql_fetch_array($place) or die("Couldn't Array: " . mysql_error());
echo '<tr><td class="nested"><a href="./management.php?mode=1&id=' . $row["id"] . '">' . $row["username"] . '</a></td>';
echo '<td class="nested"><a href="./management.php?mode=3&id=' . $row["id"] . '">Change Password</a></td>';
echo '<td class="nested"><a href="./management.php?mode=5&id=' . $row["id"] . '">Change E-Mail</a></td>';
echo '<td class="nested"><a href="./management.php?mode=7&id=' . $row["id"] . '">Change Access: ' . $row["access"] . '</a></td>';
echo '<td class="nested"><a href="./management.php?mode=11&id=' . $row["id"] . '">Delete User</a></td></tr>';
}
echo '<tr><td class="nested" colspan="5" style="text-align: center"><a href="./management.php?mode=9">Add Administrator</a></td></tr>';
mysql_close($connect);
?>
So what happens is pretty much you load management.php and and it includes management.tpl according to the case. You click on a link, and poof it asks you to login because the session was unset. The session dies when management.php is loaded, not when you click on the link. I know this because when I refresh management.php, I have to login.
May I say that this code works on another webserver. So theres something different between the two, but that could because my code is bad somewhere and one server is more lax than the other.