martynball
04-11-2012, 12:24 AM
Hey guys, any idea why Chrome is throwing this error at me?
This web page has a redirect loop
The website will not load as apparently there is a looping redirect... I don't see how that could be happening :S
<?php
session_start();
require "php/general.php";
require "pages/header.php";
$page = $_GET['page'];
//Reload page page if no URL variable is set
if ($page == "") {
header('Location: http://martynleeball.goodluckwith.us?page=main');
}
//Is the user logged in?
if (!$_SESSION['user'] || $_SESSION['sid'] != session_id()) {
//Make certain that the login page is loaded
header('Location: http://martynleeball.goodluckwith.us?page=login');
//User is not logged in, connect to database
include "php/connect.php";
}
?>
<title><?php echo $titles[$page] ?></title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript">
<?php
include $js[$page];
?>
</script>
</head>
<body>
<?php
include $pages[$page];
?>
</body>
</html>
This web page has a redirect loop
The website will not load as apparently there is a looping redirect... I don't see how that could be happening :S
<?php
session_start();
require "php/general.php";
require "pages/header.php";
$page = $_GET['page'];
//Reload page page if no URL variable is set
if ($page == "") {
header('Location: http://martynleeball.goodluckwith.us?page=main');
}
//Is the user logged in?
if (!$_SESSION['user'] || $_SESSION['sid'] != session_id()) {
//Make certain that the login page is loaded
header('Location: http://martynleeball.goodluckwith.us?page=login');
//User is not logged in, connect to database
include "php/connect.php";
}
?>
<title><?php echo $titles[$page] ?></title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript">
<?php
include $js[$page];
?>
</script>
</head>
<body>
<?php
include $pages[$page];
?>
</body>
</html>