background image

97

CHAPTER 9

Lesson 6: Creating a Main Application Page

In this lesson you will enhance the Compass Travel Trip Maintenance application. So far, you 
created a very useful drill-down query facility. Compass Travel trip coordinators can produce lists 
required by management and easily locate and display information about any trip. There are 
several requirements that were identified in 

“Lesson 1: Preparing to Build the 

Sample Application” on page 41

 that you have not yet addressed: 

The ability to browse through the Trips table.

The ability to add, delete, and edit trip information.

You will modify the Trip Detail page to accomplish this additional functionality. The Trip Detail 
page shows information about a single trip. You will convert the Trip Detail page into the main 
application page by adding the following functionality:

Navigation buttons to browse the database

Database maintenance buttons to edit, delete, and add new trips, as well as a button to search 

This lesson contains the following exercises:

Exercise 1: Creating the main application page from the Trip Detail page  . . . . . . . . . . . . . . . . 98

Exercise 2: Adding database maintenance buttons  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

Summary of Contents for COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION...

Page 1: ...COLDFUSION MX7 Getting Started Building ColdFusion MX Applications...

Page 2: ...these links only as a convenience and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third party sites Copyright 1999 2005 Ma...

Page 3: ...ocessing 27 Processing form data 28 Commenting your code 30 CHAPTER 3 Database Fundamentals 31 About database basics 31 About SQL 34 Using SQL with ColdFusion 36 PART II Building a ColdFusion Applicat...

Page 4: ...eria on the Trip Search form 82 Exercise 6 Testing the revised Trip Search Results page 83 Summary 83 CHAPTER 8 Lesson 5 Creating a Trip Detail Page 85 Exercise 1 Creating a Trip Detail page 86 Exerci...

Page 5: ...ing the current trip record shown on the Trip Detail page 129 Exercise 2 Adding trips with SQL INSERT statements 131 Exercise 3 Adding data using the cfinsert tag 135 Exercise 4 Updating a SQL row usi...

Page 6: ...6 Contents...

Page 7: ...dia com go livedocs_cfmx7docs_installing Configuring and Administering ColdFusion MX Part I describes how to manage the ColdFusion environment including connecting to your data sources and configuring...

Page 8: ...in LiveDocs which lets you add comments to pages and view the latest comments added by Macromedia by going to www macromedia com go livedocs_cfmx7docs CFML Reference Provides descriptions syntax usag...

Page 9: ...7 It defines ColdFusion MX 7 and provides an overview of the ColdFusion Markup Language CFML It also provides generic database concepts The following chapters are included in Part I Chapter 1 Introdu...

Page 10: ......

Page 11: ...ts ColdFusion application server ColdFusion Markup Language CFML ColdFusion MX Administrator The following sections describe these core components in more detail In addition the Getting Started Experi...

Page 12: ...er with an Internet connection You can manage the following configuration options with the ColdFusion MX Administrator ColdFusion data sources Debugging output Server settings Application security For...

Page 13: ...with existing Open Database Connectivity ODBC data sources by using ODBC Socket a driver that interacts with an existing ODBC driver Interacting with mobile devices ColdFusion MX 7 lets you create app...

Page 14: ...14 Chapter 1 Introducing ColdFusion MX...

Page 15: ...27 Processing form data 28 Commenting your code 30 Working with ColdFusion pages ColdFusion pages are plain text files that you use to create web applications You can create your ColdFusion applicatio...

Page 16: ...erstand this process is to create a ColdFusion page In the following procedure you will create a simple ColdFusion page by using HTML tags one ColdFusion tag and two ColdFusion functions The following...

Page 17: ...usion page 1 Create a directory called test under the web_root or web_application_root directory 2 In the test directory save the file as cfpage cfm Browsing your code To ensure that the code you wrot...

Page 18: ...m operations such as accessing a database Functions can return data and do other operations like retrieving the system date Almost everything that you want to accomplish with ColdFusion involves using...

Page 19: ...L Reference Tag attributes Tag attributes instruct ColdFusion about the details of an operation For example to update a database table ColdFusion requires specific information about the database such...

Page 20: ...eFormat Now mm dd yyyy function ColdFusion would not evaluate the function and the previous example would display your source code as follows For more information about how to use number signs with fu...

Page 21: ...store data in memory on the server Variables always have a name and a value You can assign a value to a variable or you can instruct ColdFusion to assign variable values based on data that it retrieve...

Page 22: ...important because ColdFusion supports many types of variables Use the following syntax to reference a local variable variables variablename Because ColdFusion lets you use the same name with variables...

Page 23: ...xample the following code creates a variable and instructs the ColdFusion server to return the value of the variable cfset my_first_name Kaleigh cfset my_last_name Smith cfset my_full_name variables m...

Page 24: ...ccurring when you combine CFML on a page with case sensitive languages such as JavaScript Specifying number signs to denote functions or variables In ColdFusion you specify number signs to denote func...

Page 25: ...ring My name is variables my_first_name and my age is variables my_age My name is is literal text and you therefore surround it with quotation marks The variable references variables my_first_name and...

Page 26: ...hin a second value DOES NOT CONTAIN Tests whether a value is not contained within a second value Operators Description The basic arithmetic operators addition subtraction multiplication and division I...

Page 27: ...se When using these tags you can facilitate decision making in your code The most fundamental tags used to control code execution are the cfif cfelse and cfelseif tags Because you will see and use the...

Page 28: ...red by the user If the user enters MA in the state form field the state tax results returned is 8 5 If the user enters VA in the state form field the state tax results returned is 8 2 If the user ente...

Page 29: ...m tag uses the following syntax form action actionpagename cfm method Post HTML and CFML form tags form The first attribute action in the form tag lets you specify where to send the data The page that...

Page 30: ...code on the page it is easier to make modifications Commented code tends to be better organized Comment tag The ColdFusion comment tag is similar to the HTML comment tag except that it has three dashe...

Page 31: ...nguage SQL that you use to interact with databases Contents About database basics 31 About SQL 34 Using SQL with ColdFusion 36 About database basics Even though you do not need a thorough understandin...

Page 32: ...Columns represent individual fields in a table Rows represent records of data in a table You can think of database tables as grids as in the following example Each field in the table contains one pie...

Page 33: ...ormation is the same for each employee in a given department however repeating the department information for each employee is redundant Storing redundant data takes up more disk space If the departme...

Page 34: ...e SQL SELECT statement retrieves columns of data from a database The tabular result is stored in a result table called the record set You use the following SELECT statement to retrieve information fro...

Page 35: ...ith one or more conditions these are called subclauses You join subclauses using the operators AND and OR The AND operator displays a row if all conditions that are listed are True The OR operator dis...

Page 36: ...a SQL database using the SELECT statement which are not described in this manual For more information consult a SQL reference Using SQL with ColdFusion ColdFusion communicates with your data source t...

Page 37: ...ag is the name of the query The second attribute of the cfquery tag defines the name of the data source The SELECT statement defines the fields columns to be retrieved from a table named Employee CFML...

Page 38: ...38 Chapter 3 Database Fundamentals...

Page 39: ...ation 41 Lesson 2 Configuring Your Development Environment 49 Lesson 3 Retrieving Data 59 Lesson 4 Building Dynamic Queries 71 Lesson 5 Creating a Trip Detail Page 85 Lesson 6 Creating a Main Applicat...

Page 40: ......

Page 41: ...ore you will not need to design or build the Compass Travel database It is important however for you to be familiar with the layout of the database Additionally you must understand the functional requ...

Page 42: ...es of a trip are important to Compass Travel For this you must determine the data requirements for the application Understanding the data requirements is essential to building the proper database to h...

Page 43: ...el website can market its trips online to the general public Customers who are booking a trip need to know the trip name when the trip begins and ends the price and a description Additionally the trip...

Page 44: ...umn so that your data collection forms can validate against incorrect values entered by the user Looking closer you might wonder why the eventType column is a number and not a text data type column Re...

Page 45: ...ing in the eventtypes table new mountain climbing trips would be classified differently than ones saved before the change For this reason and to save space in the database the key to the eventtypes ro...

Page 46: ...ge is where users will come to view information about trips and to navigate to other ColdFusion pages to add edit or search for new trips The following lessons explain how to do these tasks Configure...

Page 47: ...docs getting_started solutions Appended to each filename is the lesson and exercise number For example the version of the file tripdetail cfm that you would have after performing the steps in Lesson 5...

Page 48: ...n provided For information about how to configure the Compass Travel data source see Lesson 2 Configuring Your Development Environment on page 49 For additional information about configuring a data so...

Page 49: ...structure Before you begin the tutorial verify that the configuration of the computer where ColdFusion MX 7 is installed matches the file structure described in the following sections The files requi...

Page 50: ...images The image subdirectory contains the required image files for the tutorial application The photos directory contains the required photo files for the tutorial application The solutions director...

Page 51: ...MX to build the sample ColdFusion application in this tutorial see the following sections for information about configuring Dreamweaver for ColdFusion development Configuring Dreamweaver MX for ColdF...

Page 52: ...data source without leaving the Dreamweaver environment you need the following information The type of connection to use The name to call the data source The location of the database file s To configu...

Page 53: ...ss procedure is for Windows users The PointBase procedure is for UNIX and Macintosh OS X users To define the connection to the sample Microsoft Access database 1 In the ColdFusion MX Administrator sel...

Page 54: ...e that the name of the data source file does not contain any spaces If the name contains a space the data source connection fails Driver drop down selection box Select Other Field Action JDBC URL Ente...

Page 55: ...g the ColdFusion MX 7 Administrator to set debugging options Viewing debugging information within Dreamweaver Instead of enabling debugging for an application you can view debugging information for an...

Page 56: ...To enable debugging options 1 In the ColdFusion MX Administrator select Debugging Logging Debugging Settings A list of debugging options appears on the Debugging Settings page 2 Select the Enable Debu...

Page 57: ...hen using a remote client 1 In the ColdFusion MX Administrator select Debugging Logging Debugging IP Addresses The Debugging IP Address page appears 2 In the IP Address text box enter the IP address o...

Page 58: ...58 Chapter 5 Lesson 2 Configuring Your Development Environment...

Page 59: ...sson introduce you to the process of retrieving data from the Compass Travel relational database This lesson contains the following exercises Exercise 1 About the trip list 60 Exercise 2 Retrieving th...

Page 60: ...the page always shows an identical trip list it is considered a static web page You should only use static web pages when you are creating a page that is not likely to change often Using the static w...

Page 61: ...are working in Dreamweaver ensure that the site that you created in Lesson 1 is the current site For more information see Configuring Dreamweaver MX for ColdFusion development on page 51 2 Open a new...

Page 62: ...ery xxx output code block cfoutput Displaying the column contents from the SQL statement In CFML you surround variables with number signs to display their contents using the cfoutput tag You also use...

Page 63: ...r application For more information see Chapter 10 Building and Using ColdFusion Components in ColdFusion MX Developer s Guide To move the query to a CFC 1 Create the CFC file 2 Copy the query to the C...

Page 64: ...n cfcomponent 4 Save the file as gettrips cfc in the components directory Let Dreamweaver do it Dreamweaver lets you create a ColdFusion component without having to enter the code To create a CFC in D...

Page 65: ...the results of the query to the triplisting cfm page cfreturn TripList 4 Save the gettrips cfc file Calling the query method To perform the query that is now in a method in a ColdFusion component you...

Page 66: ...op a Budget Trip List report that identifies trips that are priced 1500 or less You could modify the existing query however you may need to use that query in the future Instead you can create an addit...

Page 67: ...cfc file and position the pointer before the closing cfcomponent tag 2 Click the Bindings tab 3 Click the button 4 Select Recordset Query 5 In the Name text box enter budgetTrips 6 Click the New Funct...

Page 68: ...block 2 Click the Components tab 3 Click the button next to cfdocs getting_started my_app components and click the button next to gettrips 4 Select query getBudgetTrips and drag it to the top of the...

Page 69: ...the look of this page Summary This lesson described how to access a relational database using ColdFusion You used the SQL SELECT statement and the cfquery and cfoutput tags to display trip lists You...

Page 70: ...70 Chapter 6 Lesson 3 Retrieving Data...

Page 71: ...ercise 1 Creating the trip search form As you recall from Lesson 1 Preparing to Build the Sample Application on page 41 two of the requirements for the Trip Maintenance application are the ability to...

Page 72: ...ify the trips with a price greater than 3 000 Show the trips departing after 11 11 2005 that are priced less than 2 000 There are a number of considerations to take into account when you design a sear...

Page 73: ...suppose the user wants a list of all the trips where the trip location begins with a B SQL is well suited for this type of query Typical SQL string operators are equals starts with contains and ends...

Page 74: ...H begins with select td td input type text name tripLocationValue td tr Field departureDate tr td Departure Date td td select name departureOperator option value EQUALS is option value BEFORE before o...

Page 75: ...he form fields are posted to the Trip Search Results page The posted field values compose the WHERE clause in the SQL SELECT statement The following example lists the WHERE clauses that you can genera...

Page 76: ...you use the following pseudocode cfif color EQ red statements for color red cfelse statements for other than red cfif Building a SQL WHERE clause in code is largely an exercise in string concatenation...

Page 77: ...ractice of separating business logic and presentation you put the code to build the query using dynamic SQL in a function in the CFC that you have been working with To add the new query to the CFC 1 O...

Page 78: ...do it You can use the Dreamweaver Extensions to create the CFC query To construct the query with Dreamweaver 1 Click the Bindings tab 2 Click the button 3 Select Record set Query 4 In the Name text bo...

Page 79: ...Trip Search Results page 1 Create a blank document and save it as tripsearchresult cfm in the my_app directory Note If you are using Dreamweaver select Dynamic page in the Category list and ColdFusio...

Page 80: ...ick the button next to gettrips 4 Select query getTripsFromForm and drag it to the top of the triplisting cfm file 5 Change the value of returnvariable to be the name of the query TripResult as follow...

Page 81: ...cation drop down list select the Begins With option and enter the value C in the text box b Click Search The Trip Results page displays several entries as follows c Notice in the Trip Results page tha...

Page 82: ...pointer before the cfquery code block 3 To build the departureDate WHERE subclause enter or copy and paste the code in the following table immediately before the cfquery code block For this database...

Page 83: ...1900 as the date specify 1900 1 1 on UNIX 3 Select Smaller Than and enter 0 for the price 4 Click the Search button Because the departure date is considered in the query there are no rows returned Not...

Page 84: ...84 Chapter 7 Lesson 4 Building Dynamic Queries...

Page 85: ...unctions that you use in this lesson to enhance the sample ColdFusion application Element Type Description DollarFormat Function Returns a number as a String formatted with two decimal places a thousa...

Page 86: ...dress of the page with an ID For example to view trip information for Rio Cahabon Rafting with tripID 24 you open a browser and enter the following URL http localhost cfdocs getting_started my_app tri...

Page 87: ...s public returntype query cfset var tripDetails cfquery name tripDetails datasource CompassTravel maxrows 1 SELECT FROM trips cfif IsDefined URL ID WHERE tripID URL ID cfif cfquery cfreturn tripDetail...

Page 88: ...by adding the highlighted text cfquery name tripDetails datasource CompassTravel maxrows 1 SELECT FROM trips cfif IsDefined URL ID WHERE tripID URL ID cfif cfquery 21 Save the file To display the resu...

Page 89: ...rip Leader td td tripLeader td tr tr td valign top Number People td td numberPeople td tr tr td valign top Deposit Required td td depositRequired td tr tr td valign top Photo File td td photo td tr ta...

Page 90: ...etail page 1 Open a browser 2 Enter one of the following URLs which use the tripID of 24 which specifies the Rio Cahabon Rafting trip http localhost cfdocs getting_started my_app tripdetail cfm ID 24...

Page 91: ...QL statement is built dynamically In the Trip Maintenance application when the client program or user passes an ID in the URL that calls the Trip Detail page the page displays the relevant trip inform...

Page 92: ...m attack To eliminate this risk you should use ColdFusion functions such as Val to perform type checking on all URL parameters For queries you can also use the cfqueryparam tag which is explained in C...

Page 93: ...Enhancing the look of the Trip Search Results and Trip Detail pages The Trip Maintenance application now provides a useful drill down mechanism for locating trips Although this application is function...

Page 94: ...returnDate and price indicated in the table 4 Save the file To view the application s new appearance 1 View the tripsearchform cfm page in the my_app directory in your browser 2 In the Trip Location...

Page 95: ...ip Detail page to show more information about a particular trip You also formatted the Trip Search Results and Trip Detail pages using the CFML DateFormat and DollarFormat functions You linked the Tri...

Page 96: ...96 Chapter 8 Lesson 5 Creating a Trip Detail Page...

Page 97: ...t addressed The ability to browse through the Trips table The ability to add delete and edit trip information You will modify the Trip Detail page to accomplish this additional functionality The Trip...

Page 98: ...85 is very useful when the user knows some search criteria to enter Flipping back and forth between the results page and the detail page to navigate through a record set can be tedious Moreover on occ...

Page 99: ...ame btnLast src images last gif form Note The current trip record ID tripID is in a hidden field in the form code This field provides the action page with current record ID that it must have in order...

Page 100: ...ceaction cfm page To add maintenance buttons 1 Open the tripdetail cfm file from the my_app subdirectory 2 Enter the following code immediately after the cfoutput query TripQuery tag form action maint...

Page 101: ...use the Maintenance Action page does not exist The Maintenance Action page is required to process the maintenance button requests You will develop this page in Lesson 7 Validating Data to Enforce Busi...

Page 102: ...102 Chapter 9 Lesson 6 Creating a Main Application Page...

Page 103: ...of the trip photo file 120 ColdFusion tags and functions introduced in this lesson The following table describes the ColdFusion tags and functions that you use in this lesson to enhance the ColdFusion...

Page 104: ...6 Creating a Main Application Page on page 97 The following figure shows the Trip Edit page The page appears when the user clicks the Add or Edit button on the main Trip Maintenance application page t...

Page 105: ...TR TD valign top Departure Date TD TD INPUT name departureDate size 10 TD TR Field returnDate TR TD valign top Return Date TD TD INPUT name returnDate size 10 TD TR Field numberPeople TR TD valign to...

Page 106: ...a data entry form by using the form tag The form tag takes two tag attributes for example form action tripeditaction cfm Method Post Here the action attribute specifies the name of the ColdFusion fil...

Page 107: ...cfoutput body html 3 Save the page as tripeditaction cfm in the my_app directory To test the trip edit page 1 Open the tripedit cfm page in the my_app directory in a browser 2 In the Trip Name field...

Page 108: ...use special tags to simplify the process of enforcing business rules Using ColdFusion it is possible to enforce business rules in several places For example you can enforce some validation edits on th...

Page 109: ...le is to create a local variable with a cfset tag within the action page that tests whether any of the business rules failed The cfset tag lets you manipulate the value of a variable For example the f...

Page 110: ...t evaluate to either True or False To use the cfif tag to test whether a trip name was entered business rule 1 on the Trip Edit form you add the following cfif statement cfif Form tripName EQ cfoutput...

Page 111: ...ot IsDefined returns True if the specified variable is not found and the cfset statement sets the form variable to No A value of No indicates that a deposit is not required a value of Yes indicates th...

Page 112: ...ng is selected by default there is always a value for event type 4 Trip locations are required Trip location is required cfif Form tripLocation EQ cfset IsOk No cfoutput Trip location cannot be blank...

Page 113: ...cfoutput cfelse Price must be 20 greater than Base Cost cfif Form basecost 1 2 GT Form price cfset IsOk No cfoutput Price must be marked up at least 20 above cost cfoutput cfif cfif 8 Any trip priced...

Page 114: ...data on the client using ColdFusion form tags In this exercise you will compare server side and client side validation You then modify the testedit cfm page to use client side scripting Comparing serv...

Page 115: ...cannot be blank validate integer required Yes size 3 maxlength 3 Attribute Description validate The data type that the field tag validates against Values include integer date time telephone zipcode m...

Page 116: ...llowing appropriate values The following table contains the revised code blocks Attribute value Description required Use this attribute for fields that must be filled out or selected validate Use this...

Page 117: ...cfinput name departureDate size 10 required Yes validate date message Departure date must be a valid date cfinput name returnDate size 10 required Yes validate date message Return date must be a vali...

Page 118: ...cfm page appears as follows cfset isOk Yes cfif not isdefined Form depositRequired cfset form depositRequired No cfif cfif Form price GT 750 AND Form depositRequired EQ No cfset IsOk No cfoutput Depos...

Page 119: ...To retrieve the data from this table you must include the following cfquery cfquery name GetEvents datasource CompassTravel SELECT eventType eventTypeID FROM eventtypes cfquery To exploit the query in...

Page 120: ...ule does not fit nicely into this design however This business rule has two parts A photo filename must accompany all new trips The photo image file must reside in the images directory of the Compass...

Page 121: ...otoLocation C tag For example depending on your web server configuration the PhotoLocation path might be For MS Windows systems cfset PhotoLocation C CFusionMX7 wwwroot cfdocs getting_started photos o...

Page 122: ...on you will write code to add trips to the database Additionally you will add logic to update existing trip data in the Trips table Code Explanation cfset PhotoLocation C CFusionMX7 wwwroot cfdocs get...

Page 123: ...users to browse trip details In Lesson 6 Creating a Main Application Page on page 97 you added buttons to the Trip Detail page to browse records in the database In this exercise you build the action...

Page 124: ...n 4 Building Dynamic Queries on page 71 you used ColdFusion string manipulation to construct the proper SQL SELECT WHERE clause In this lesson you use a similar approach to build the WHERE clause for...

Page 125: ...ame TripQuery datasource CompassTravel maxrows 1 SELECT tripID FROM trips cfif IsDefined Form btnPrev X WHERE tripID Form RecordID ORDER BY tripID DESC cfelseif IsDefined Form btnNext X WHERE tripID F...

Page 126: ...tripID FROM trips cfif IsDefined Form btnPrev X WHERE tripID Form RecordID ORDER BY tripID DESC cfelseif IsDefined Form btnNext X WHERE tripID Form RecordID ORDER BY tripID cfelseif IsDefined Form bt...

Page 127: ...icked Search cfelseif IsDefined Form btnDelete Code to execute if the user clicked Delete cfelseif IsDefined Form btnEdit Code to execute if the user clicked Edit cfelseif IsDefined Form btnAdd Code t...

Page 128: ...nting the Maintenance Action page you enabled users to take action on the current trip You used the ColdFusion cflocation tag to link the search page to the Trip Detail page In the next lesson You hav...

Page 129: ...the Trip Edit page to the main page 138 Exercise 6 Inserting values in the edit form 139 ColdFusion tags introduced in this lesson The following table identifies the ColdFusion tags that you use in t...

Page 130: ...nput tag from the Trip Detail page the following SQL statement deletes a row from the Trips table DELETE FROM trips WHERE tripID Form RecordID To enable users to delete trips 1 Open the maintenanceact...

Page 131: ...because you deleted the trip Exercise 2 Adding trips with SQL INSERT statements In Lesson 8 Implementing Browsing and Searching on page 123 you built a Trip Edit page to collect the data Now you can m...

Page 132: ...For this approach you use the following syntax INSERT INTO table_name column1 column2 VALUES value1 value2 For example to add Kaleigh Smith of Windham with an unknown address you use the named column...

Page 133: ...Form tripLocation Form departureDate Form returnDate Form price Form tripLeader Form photo Form baseCost Form numberPeople Form depositRequired cfquery UNIX users using PointBase Insert the new trip...

Page 134: ...the Begins With option and enter the value Nor in the text box 5 Click Search The TripResults page appears 6 Click NH White Mountains to display the details of the trip you just added Verify that all...

Page 135: ...tes Code Explanation cfquery name AddTrip datasource CompassTravel Using the datasource attribute the cfquery tag connects to the CompassTravel data source and returns a result set identified by the n...

Page 136: ...tRequired cfquery 3 Add the following cfinsert tag to insert data into the trips table in the same location as the code that you just deleted cfinsert datasource CompassTravel tablename trips 4 Save t...

Page 137: ...the cfupdate tag has datasource and tablename attributes to specify where the data is to be inserted The tag also has a formfields attribute to identify which fields are to insert The formfields attr...

Page 138: ...on page 103 the action page for the maintenance buttons on the main page is maintenanceaction cfm You previously added code for the Search and Delete buttons In this exercise you add code for the Add...

Page 139: ...it cfm file in your editor 2 Enter or copy and paste the following code after the cfquery block that appears at the top of the file cfif IsDefined URL ID cfquery name TripQuery datasource CompassTrave...

Page 140: ...ip Name to be blank if the ID is undefined otherwise set the value equal to the Trip Name that appeared on the Trip Detail page TD cftextarea name tripDescription required Yes message Trip description...

Page 141: ...ed and must be numeric TD Set the value of the Price to be blank if the ID is undefined otherwise set the value equal to the Price that appeared on the Trip Detail page TD cfinput name baseCost size 1...

Page 142: ...cfif IsDefined URL ID WHERE tripID ID cfif cfquery Set the local variables cfset tripName TripQuery tripName cfset eventType TripQuery eventType cfset tripDescription TripQuery tripDescription cfset...

Page 143: ...sing the Login Wizard can perform simple authentication authentication against a Microsoft Windows NT domain or authentication against a Lightweight Directory Access Protocol LDAP server In Dreamweave...

Page 144: ...the remote server You can move the application files to the remote server either by using the Login Wizard which uses Dreamweaver or by using Dreamweaver directly Creating an application that include...

Page 145: ...from Dreamweaver To start the Login Wizard 1 Start Dreamweaver 2 Ensure that the active site is the one for which you want to restrict access Note The currently active site must be a local site The R...

Page 146: ...nation for each application The Login Wizard creates the files necessary to restrict access to your application The Wizard then displays a list of the files 7 To deploy the modified application to you...

Page 147: ...t only employees of Compass Travel can access the application you have built you use the Login Wizard to provide user authentication You specify only one username and password that all employees of Co...

Page 148: ...CompassStaff as the user name 3 Enter Columbus92 as the password Summary In this lesson you learned how to use the Login Wizard to provide user authentication for a site and added user authentication...

Page 149: ...ag 76 cfif tag 82 109 cfinput tag 103 cfinsert tag 129 cflocation tag 123 CFML basics 15 30 building applications 13 commenting code 30 elements 18 23 expressions 23 27 functions 19 operators 26 SQL 3...

Page 150: ...displaying dates 66 query results 68 88 search results 79 trip information 60 trips by price 66 variables 62 DollarFormat function defined 85 Dreamweaver creating CFC queries 67 78 87 creating CFCs 6...

Page 151: ...ber signs using 62 O operators about 25 27 for querying 73 P photo file testing existence of 120 PointBase database about 82 133 configuration 54 primary key defined 45 Q queries copying to CFCs 65 di...

Page 152: ...trip search results page 79 tutorial adding and updating SQL data 129 application business rules 108 application requirements 42 creating main application page 85 95 97 101 data requirements 43 datab...

Reviews: