O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Multiple-Condition If Statements

A couple of problems exist with the code in Listing 9.1, the most important of which is that weekends include both Sundays and Saturdays. Therefore, the code to check whether it is the weekend needs to check for both days.

Here is a revised version of the code (see Listing 9.2); save this file as if2.cfm, and then execute it.

Tip

So as not to have to retype all the code as you make changes, use Dreamweaver’s File > Save As menu option to save the file with the new name, and then edit the newly saved file.

Listing 9.2. if2.cfm
<!--- Name: if2.cfm Author: Ben Forta (ben@forta.com) Description: Demonstrate use of multiple conditions Created: 07/01/2007 ---> <html> <head> <title>If 2</title> </head> <body> <!--- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required