Re: ][Whats Wrong With This][
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
header("Location: index.php?page=maintenance");
exit;
}
else {
}
if ($_SERVER['REQUEST_URI'] == "/") {
header("Locaiton: index.php?page=home");
exit;
}
else {
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
header("Locaiton: ~~~");
exit;
}
else {
}
?>
Re: ][Whats Wrong With This][
Quote:
Originally Posted by
EliteGM
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
header("Location: index.php?page=maintenance");
exit;
}
else {
}
if ($_SERVER['REQUEST_URI'] == "/") {
header("Locaiton: index.php?page=home");
exit;
}
else {
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
header("Locaiton: ~~~");
exit;
}
else {
}
?>
Warning: Cannot modify header information - headers already sent by (output started at /home/alpha/public_html/beta/includes/home.php:1) in /home/alpha/public_html/beta/index.php on line 16
Re: ][Whats Wrong With This][
Then.. theres some code echoed before that ?
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />");
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />");
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=~~~' />");
exit;
}
?>
You also don't need extra
Those are unnecessary.
Re: ][Whats Wrong With This][
Quote:
Originally Posted by
EliteGM
Then.. theres some code echoed before that ?
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />");
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />");
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=~~~' />");
exit;
}
?>
You also don't need extra
Those are unnecessary.
done that. btw, when it echos to maintenace page. it just keeps redirecting.
Re: ][Whats Wrong With This][
Oops, my bad!
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=~~~' />";
exit;
}
?>
Re: ][Whats Wrong With This][
Quote:
Originally Posted by
EliteGM
Oops, my bad!
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
case 'forum':
include("includes/forum.php");
break;
case 'maintenance':
include("includes/forum.php");
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=~~~' />";
exit;
}
?>
done that. btw, when it echos to maintenace page. it just keeps redirecting.
Re: ][Whats Wrong With This][
Try addind exit(); in each case after the include
Re: ][Whats Wrong With This][
Quote:
Originally Posted by
EliteGM
Try addind exit(); in each case after the include
still does it
current code;
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
exit();
case 'forum':
include("includes/forum.php");
break;
exit();
case 'maintenance':
include("includes/maintenance.php");
break;
exit();
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
?>
Re: ][Whats Wrong With This][
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
exit();
break;
case 'forum':
include("includes/forum.php");
exit();
break;
case 'maintenance':
include("includes/maintenance.php");
exit();
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
/*if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
What's it for anyway?
*/
?>
Re: ][Whats Wrong With This][
Quote:
Originally Posted by
EliteGM
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
exit();
break;
case 'forum':
include("includes/forum.php");
exit();
break;
case 'maintenance':
include("includes/maintenance.php");
exit();
break;
//Etc
}
if ($site['maintenance'] == "1") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
/*if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
What's it for anyway?
*/
?>
add my msn.
james.freeman@live.co.uk
Re: ][Whats Wrong With This][
why not add the maintence at the top,
So if its in main it wont execute the select case,
But just shows the main directly.
And wont load the other stuff ofcourse place a exit after it ;).
And stop the un needed quoting
Re: ][Whats Wrong With This][
Re: ][Whats Wrong With This][
Lmao pointless post ^.
We've already solved his problem, no need for anymore posts unless he gets another error with the script.
Re: [PHP] Whats Wrong With This
Oh, sorry, shouldn't this thread be closed then
Or summin?
Re: [PHP] Whats Wrong With This
PHP Code:
<?php
switch($_GET['page']){
case 'home':
include("includes/home.php");
break;
exit();
case 'forum':
include("includes/forum.php");
break;
exit();
case 'maintenance':
include("includes/maintenance.php");
break;
exit();
//Etc
}
if ($site['maintenance'] == "1" && $_GET['page'] != 'maintenance') {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=maintenance' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
if ($_SERVER['REQUEST_URI'] == "/index.php") {
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=home' />";
exit;
}
?>
try this one