Combining The Codes :P please help

Shadow121

Member
Messages
901
Reaction score
0
Points
16
I have a big code here that i want simplified and stuck into one big code. When i did it, it wasn't showing my layout So, heres the code.
PHP:
<?
ob_start();
include("config.php"); 
if(!$logged[username] && $setting[status] == Offline){  // Checks to see if the person is logged in and if the status is offline
exit("$setting[reason]");
}elseif($logged[username] && $setting[status] == Offline && $setting[immunity] == 1){ // If they ARE logged in and the status is offline and the immunity is on, we check their level.
if($logged[username] && $logged[level] != $setting[immune_lvl]){ // If their level does NOT equal the immune level, we exit.
exit("$setting[reason]");
}else{ // If the person is immune, we show them the site :D
}
}elseif($setting[status] == Offline && $setting[immunity] == 0){ // If the status equals offline AND the immunity feature is off, we exit.
exit("$setting[reason]");
}elseif($setting[status] == Online){ // If the status is online, we show them the site :D
} 
   if ($logged[username])
   {
      echo("");
   }
   else
   {
      echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>");
   }
?> 
<?
   ob_start();
   include("config.php");
   if ($logged[level] == 2)
   {
      echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>");
   }
   else
   {
      echo("");
   }
?> 
<?php
ob_start();
include("config.php");
if ($logged[banned] == banned) 
{
echo "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/banned.php\"/>";
}else{
echo "";
}
?>
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
A few suggestions that may help you fix your code:
  1. Clean up your array, specifically the way you are using them. ($settings['key'] rather than $settings[key])
  2. Use only one ob_start(), and end the script with ob_end_flush().
  3. Get rid of the multiple includes for your config.php file, you only need one.
  4. Align and indent your code, and use parentheses in your if statements.
  5. Get rid of all of your echo's that aren't doing anything, you don't need them.

If you clean it up and it's still not working for you, post it back here and I'll take a look at it.
 
Last edited:

Shadow121

Member
Messages
901
Reaction score
0
Points
16
Nope, it doesn't work its not showing me the layout still.

PHP:
<?php
	ob_start();
			include("config.php");
		if(!$logged[username] && $setting[status] == Offline){
	exit("$setting[reason]");
			}elseif($logged[username] && $setting[status] == Offline && $setting[immunity] == 1){
		}elseif($logged[username] && $logged[level] != $setting[immune_lvl]){
	exit("$setting[reason]");
			}elseif($logged[username] && $logged[leve] == $setting[immune_lvl]){
		}elseif($setting[status] == Offline && $setting[immunity] == 0){
	exit("$setting[reason]");
			}elseif($logged[username] && $setting[status] == Online){
		}elseif(!$logged[username]){
	echo "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/\"/>";
			}elseif($logged[username] && $logged[level] == 2 && $logged[banned] == banned){
		echo "<meta http-equiv=\"Refresh\" content=\"0; URL=http://hrwp.hrwp.exofire.net/banned.php\"/>";
	}else{
			}
		ob_end_flush();
?>
 
Last edited:

jensen

Active Member
Messages
1,168
Reaction score
22
Points
38
Hve you tried...

content=\"0; URL=\"http://hrwp.hrwp.exofire.net/\"\"/>
 
Top