View Single Post
Old 03-05-2008, 10:18   #7 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 1,456
What's going on with the default case?

Firstly it has no break; so I think anything which takes the default branch will trickle down into the about case. Then you seem to have several redundant lines of code at the bottom of the switch without a case (is that supposed to be the default branch?) Presumably you make the assignment to $page somewhere else in the code?

Just a couple of other observations - why not use single quotes for the $css = '...' - then you don't need to escape every occurrence of double quotes:

$css = '<link href="iestyle.css" rel="stylesheet" type="text/css" />';

is a lot more readable than:

$css="<link href=\"iestyle.css\" rel=\"stylesheet\" type=\"text/css\" />";

Also, I think it's good practice to quote strings, even though in a case statement you aren't forced to. Again it makes the code clearer. Although since you use ternary form for your conditional, I guess clarity isn't a big concern for you.

Edit: I love it when someone else answers between starting and finishing a comment
  Reply With Quote