Forum Moderators: coopster
session_start();
if(!(isset ($_SESSION['username'])) && ($_SESSION["profile"]!=2)){
header("location:index.php");
} session_start();
if(!isset($_SESSION['username'])){
header("location:index.php");
}
else if($_SESSION["profile"]!=2){
header("location:index.php");
} session_start();
if(!(isset ($_SESSION['username'])) && ($_SESSION["profile"]!=2)){
header("location:index.php");
} ...but for some reason the condition with && doesnt work and the else if one does.
$a = 1;
$b = 3;
if ($a == 0)
echo "A = Zero and B = Any\n";
else if ($b != 2)
echo "A = Any but not Zero and B = Any but not Two\n";
if (($a == 0) && ($b != 2))
echo "A = Zero and B = Any but not Two\n";
else
echo "A = Any, may be Zero and B = Any, may be 2\n";