I have the following code:
PHP
if($brand == 'ABC' && $main == ''){
include '../_inc/report.php';
}else
if($brand == 'ABC' && $main == 'TRUE'){
include '../_inc/analysis.php';
}else
if($brand == 'XYZ' || $brand == '123' || $brand == '1A9' && $main == ''){
include '../_inc/report.php';
}else
if($brand == 'XYZ' || $brand == '123' || $brand == '1A9' && $main == 'TRUE'){
include '../_inc/analysis.php';
}
Information is passed to the PHP page within the URL, such as:
?br=ABC&cr=MAY2014&pd=NOV2013&mn=TRUE
?br=XYZ&cr=MAY2014&pd=NOV2013&mn=TRUE
And handled as follows:
$brand = $_GET['br'];
$main = $_GET['mn'];
What is happening is that if $brand = ABC and $main = TRUE
then the analysis.php
is loaded successfully (which is correct).
However, if $brand = XYZ and $main = TRUE
then report.php
is loaded, which is not the behaviour I expect or need.
Is this connected with the way the operators work or is my code incorrect. Any help and feedback welcomed.