I\'ve been working on this bit of code for about an hour and can\'t seem to figure out why it\'s not working. Does PHP allow If/Else statements within While loops? I\'ve tri
if ($layout = "vertical")
should be:
if ($layout == "vertical")
Otherwise you are assinging a value to $layout of 'vertical' opposed to comparing it's value to see if it's equal to 'vertical'. That assignment will otherwise equal to true, reason the first part runs and the ELSE does not.
One method I use to prevent accidents like this is to put the constant first such as:
if ("vertical" == $layout)
That way if I miss the other = sign PHP will error, rather than assign the value erroneously.