[PHP] Whats Wrong With This

Re: ][Whats Wrong With This][

Oops, my bad!

PHP:
<?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

still does it
current code;
PHP:
<?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:
<?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][

PHP:
<?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.
[email protected]
 
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][

Lmao pointless post ^.

We've already solved his problem, no need for anymore posts unless he gets another error with the script.
 
PHP:
<?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
 
PHP:
<?
    $p = $_GET['p'];
    if($p == "rpc" || $p == "lol"){
    if($p == "rpc"){
        include('test.php');
            } elseif($p == "lol"){
            include ('lol.php');
            } else {
            {
            exit;
}
}
//Begin Getting Stuff Like index.php?home
?>

Not an expert yet, try that though ;)
 
Back