On Wed, Aug 05, 2009 at 02:55:07PM -0700, Ben Dunlap wrote:
> > In my navigation.php include file, I had if ($page = about) echo href
> > I changed it to if ($page == about) echo and it suddenly
> worked! Imagine
> > that...
>
> Another good case for putting the variable on the right side
Yes, that's a golden rule for a bug free code.
The rule shoudl be something like this...
Whenever you have a constant value evaluated to a non-constant value
put them in the left side of the expression.
if( 'constant' == $non_constant )
echo ' variables has that name for anything ';
if( fals
> In my navigation.php include file, I had if ($page = about) echo href
> I changed it to if ($page == about) echo and it suddenly worked! Imagine
> that...
Another good case for putting the variable on the right side of "==":
if ("about" == $page)
Then if you mis-type "==" as "=", PH
I just wanted to let know I figured out my last issue (last as in, for now).
In my navigation.php include file, I had if ($page = about) echo href
I changed it to if ($page == about) echo and it suddenly worked! Imagine
that...
Thanks all for you help, you are celebrities in my book now.
4 matches
Mail list logo