Page 1 of 1

Need meaning of an if statement.

Posted: Wed May 20, 2009 8:34 am
by joelitos
This are set ups values on the top of the page

Code: Select all

$submenu = false;
$cat = isset($_GET['subject']) && is_numeric($_GET['subject'])?$_GET['subject']:null;

And this line is within the code and uses those values.

Code: Select all

if($submenu == false && !is_null($cat) && $cat == $row['id'])
What this line means according to the set up values above?

in Special the $submenu variable why does its value needed to be assign to false here and then use it in that conditioned line?

Re: Need meaning of an if statement.

Posted: Wed May 20, 2009 11:09 am
by gregor171
Looks like a part of navigator code.

I believe that there should be a line that sets $submenu somewhere up the code or in else sentence that follows if.

The other possibility is that a submenu haven't been implemented.

$cat in the other hand has integer value (what isn't best SEO practice) and matches the row id to enter if sentence.
Best seo practice would be string value to be careful (security) matched to a $submenu mapper.

I'm not sure that this answers the question?!