CFML File Extensions
Which file extension is commonly used for files containing ColdFusion Markup Language code?
- .cfm
- .php
- .cfml
- .cfs
- .cfmx
Outputting Data
Which CFML tag is used to display the value of a variable named message on a web page?
- u003Ccfoutputu003E#message#u003C/cfoutputu003E
- u003Ccfprintu003E@message@
- u003Ccfdisplayu003E$message$
- u003Ccfshowu003E{message}
- u003Ccfviewu003Emessageu003C/cfviewu003E
Conditional Logic
If you want to execute certain code only when a user is logged in, which CFML tag should you use to check this condition?
- u003Ccfifu003E
- u003Ccfcaseu003E
- u003Ccfwhileu003E
- u003Ccfswitchu003E
- u003Ccfwhenu003E
Variables in CFML
How do you correctly reference a variable called userName in a CFML template?
- #userName#
- #User-Name#
- user.Name
- $userName$
- [userName]
Comments Syntax
What is the correct CFML syntax for writing a single-line comment?
- u003C!--- This is a comment ---u003E
- // This is a comment
- u003C!-- This is a comment --u003E
- #-- This is a comment --#
- u003Ccfcommentu003EThis is a comment
Loops in CFML
Which CFML tag is used to loop through a set of items, such as an array or a query?
- u003Ccfloopu003E
- u003Ccfiterateu003E
- u003Ccfrepeatu003E
- u003Ccfrowu003E
- u003Ccfrunu003E
Querying a Database
To execute a SQL query and retrieve data from a database within a CFML page, which tag should you use?
- u003Ccfqueryu003E
- u003Ccfdatau003E
- u003Ccfsqlu003E
- u003Ccfsearchu003E
- u003Ccfdbu003E
CFML Data Types
Which of the following is NOT a common data type supported in CFML?
- Sound
- String
- Boolean
- Array
- Date
Defining Functions
What CFML tag is used to define a custom function inside your application?
- u003Ccffunctionu003E
- u003Ccffuncu003E
- u003Ccfmethodu003E
- u003Ccfdefineu003E
- u003Ccfprocu003E
Passing Form Data
When a form is submitted in a CFML application, through which scope can you access the submitted form fields?
- form
- input
- query
- post
- urlform