include script - the page loads forever..
Posted: Mon May 11, 2009 4:16 pm
I've got an include script that looks like this:
settings.php got the following at the top:
When I addedThe page loads forever (EXCEPT when I'm viewing the page with settings.php?userID=XXX (only when I'm using main.php?page=settings&userID=XXX!)). Originally, I used this code, but the same problem occured:
Code: Select all
if($_GET['page'] == 'page1') {
include('page1.php');
} elseif($_GET['page'] == 'settings') {
include('settings.php');
} elseif($_GET['page'] == 'info') {
include('info.php');
} else {
include('404.php');
}Code: Select all
<?php
session_start();
if(!$_SESSION['user']) {
header("Location: index.php");
die();
} elseif((!is_numeric($_GET['userID'])) || (strlen($_GET['userID']) == 0)) {
header("Location: main.php");
die();
} else {
if($_SESSION['admin_id'] != $_GET['userID']) {
if($_SESSION['access'] < 2) {
// Carry on!
} else {
header("Location: main.php?page=settings&userID=".$_SESSION['admin_id']);
die();
}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">...Code: Select all
if($_SESSION['admin_id'] != $_GET['userID']) {
if($_SESSION['access'] < 2) {
// Carry on!
} else {
header("Location: main.php?page=settings&userID=".$_SESSION['admin_id']);
die();
}
}Code: Select all
<?php
session_start();
if(!$_SESSION['user']) {
header("Location: index.php");
die();
} elseif((!is_numeric($_GET['userID'])) || (strlen($_GET['userID']) == 0)) {
header("Location: main.php");
die();
} elseif(($_SESSION['admin_id'] != $_GET['userID']) && ($_SESSION['access'] < 2)) {
header("Location: main.php?page=settings&userID=".$_SESSION['admin_id']);
die();
} else {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">...