September 2007
Intermediate to advanced
600 pages
20h 21m
English
There’s one more feature of <cfif> that you need to look at—support for multiple independent conditions (as opposed to one condition made up of multiple conditions).
The best way to explain this is with an example. In the previous listings, you displayed a message on weekends. But what if you wanted to display different messages on Sunday and Saturday? You could create multiple <cfif> </cfif> blocks, but there is a better way.
Listing 9.5 contains yet another version of the code; this time the file name should be if5.cfm.
<!--- Name: if5.cfm Author: Ben Forta (ben@forta.com) Description: Demonstrate <cfelseif> use Created: 07/01/2007 ---> <html> <head> <title>If 5</title> </head> <body> <!--- Get day ... |
Read now
Unlock full access