Jump to content

Recommended Posts

<?php 
$tac = isset($_GET['subt'])  && is_numeric($_GET['subt'])?$_GET['subt']:null;
$drop = isset($_GET['menu'])  && is_numeric($_GET['menu'])?$_GET['menu']:null;
?>
<?php 
if(($drop != '') && ($tac == 1) || ($drop != '') && ($tac == 2)){
// this is displaying ok.
}
elseif(($drop != '') && ($tac == 3)) {
// this script is displaying ok.
}

  elseif(($tac == 1 ) || ($tac == 2) || ($tac == 3) || ($tac == 5)){

// this is displaying ok as well.
}

elseif($tac == 4){ 
// displaying ok.
}

elseif (($drop != '') && ($tac == 4)) { 
// But then this one is not displaying why? at the moment there is not error displaying in the screen.
// it just display the html code of this condition elseif($tac == 4) 
//instead of the html inside of elseif (($prod != '') && ($cat == 4)) 
//I was wondering since ($tac == 4)  condition is in both elseif statment is getting php confused?  ...

}

?>

 

The comments are inside the script it self.

 

help Don't know what's really going on.

Order of Operations.

 

elseif($tac == 4){ 
// displaying ok.
}

elseif (($drop != '') && ($tac == 4)) { 

 

$tac == 4 up above that, so there for the second elseif there cannot be ran as the one above it will be entered no matter what. Flip those around and it should work as you expect.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.