Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 Blind Folio i
®
Dreamweaver MX: The Complete Reference
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:56 AM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 Blind Folio ii
About the Authors Ray West is the Vice President and CIO of Workable Solutions, Inc., an Orlando-based company specializing in the Web-based administration of health care alliances. He has been building data-driven Web applications since 1995 including work for HBO, NBC, and USAToday, and is coauthor of the best-selling book Dreamweaver UltraDev 4: The Complete Reference (Osborne, 2001). Ray lives in Orlando with his wife and son. Tom Muck is co-author of four books, including the bestseller Dreamweaver UltraDev4: The Complete Reference. He is an extensibility expert focused on the integration of Macromedia products with ColdFusion and other languages, applications, and technologies. Tom has been recognized for this expertise as the 2000 recipient of Macromedia’s Best UltraDev Extension Award; he also authors articles and speaks at conferences on this and related subjects. As Senior Applications Developer for Integram in Northern Virginia, Tom develops back-end applications for expedited, electronic communications. Tom runs the Basic-UltraDev site with Ray West and is a founding member of the DW Team (www.dwteam.com).
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:56 AM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 Blind Folio iii
Dreamweaver MX: The Complete Reference ®
Ray West and Tom Muck
McGraw-Hill/Osborne New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:57 AM
ebook_copyright 6x9.qxd
11/20/02
10:01 AM
Page 1
Copyright © 2002 by The McGraw-Hill Companies, Inc. All rights reserved. Manufactured in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-222872-5 The material in this eBook also appears in the print version of this title: 0-07-219514-2 All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at
[email protected] or (212) 904-4069.
TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS”. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. DOI: 10.1036/0072228725
DOI Page 6x9
11/12/02
10:11 AM
Page 1
Want to learn more? ,
We hope you enjoy this McGraw-Hill eBook! If you d like more information about this book, its author, or related books and websites, please click here.
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter FM:v
For more information about this title, click here.
Contents at a Glance Part I Getting Started with Dreamweaver MX 1 2 3 4 5 6
And Then There Was One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring Your Environment . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver MX Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Building Your First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Publishing Your Site to the Internet . . . . . . . . . . . . . . . . . . . . . .
3 21 45 87 107 131
Part II Web Site Design and Construction 7 8 9 10
Designing and Planning Your Site . . . . . . . . . . . . . . . . . . . . . . . Defining Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Advanced Page Design Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . Fireworks MX Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
149 161 201 233
v Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:57 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
vi
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
11 Flash Integration Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 JavaScript and DHTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
253 271 293
Part III An Introduction to Web Scripting 14 15 16 17 18 19
Developing a Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . Active Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Java Server Pages in the Dreamweaver MX Environment . . . ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
339 349 385 425 489 537
Part IV Adding Database Features to Your Site 20 21 22 23 24 25
Making a Database Connection . . . . . . . . . . . . . . . . . . . . . . . . . Designing a Relational Database . . . . . . . . . . . . . . . . . . . . . . . . Setting Up Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . An Overview of the Structured Query Language . . . . . . . . . . Adding Database Features to Your Site . . . . . . . . . . . . . . . . . . . User Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
555 591 611 639 669 709
Part V Advanced Data Integration 26 27 28 29
Advanced Database Features . . . . . . . . . . . . . . . . . . . . . . . . . . . Advanced Scripting Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server-Side Flash Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . E-Commerce with Dreamweaver MX . . . . . . . . . . . . . . . . . . . .
747 777 799 829
Part VI Getting the Most Out of Dreamweaver MX 30 Extensions and the Extension Manager . . . . . . . . . . . . . . . . . . . 31 Dreamweaver MX Extensibility Model . . . . . . . . . . . . . . . . . . . 32 Building Server Behavior Extensions . . . . . . . . . . . . . . . . . . . . .
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:58 AM
869 895 969
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter FM:vii
For more information about this title, click here.
Contents Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxi xxiii xxv
Part I Getting Started with Dreamweaver MX
1
And Then There Was One . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The History of the Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The World Wide Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Internet Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transmission Control Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hypertext Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hypertext Markup Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Last Few Years . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WYSIWYG HTML Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UltraDev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary: And Then There Was One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 5 7 8 8 10 10 11 14 15 15 16 19 19 20
vii Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:58 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
viii
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
2
3
4
Configuring Your Environment . . . . . . . . . . . . . . . . . . . . . . . .
21
Picking Your Team . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Data Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Staging Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Live Data Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Active Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Java Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Popular Web Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Personal Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Internet Information Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iPlanet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Popular Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft Access and ISAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Popular Database Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22 23 24 24 25 25 26 26 28 28 29 30 30 30 35 38 39 39 39 41 43 43 44
Dreamweaver MX Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
45
Working with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Site Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining a Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Managing Site Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding New Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . Managing Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Document Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver’s Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Insert Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Modify Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Text Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Commands Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Site Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46 46 49 62 63 64 67 71 74 74 76 78 80 81 82 83 84 84 85 85 86
Building Your First Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
87
Constructing Web Pages in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
88 89 94
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:58 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
5
6
The Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fireworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
98 98 105 106
Adding Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
Creating Pages from Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Assets Panel to Create Templated Pages . . . . . . . . . . . . Adding Templates to Existing Pages . . . . . . . . . . . . . . . . . . . . . . . . Applying Templates to Templated Pages . . . . . . . . . . . . . . . . . . . . Managing Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Page Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rollover Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reference Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Assets Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
108 112 113 114 115 115 115 118 119 120 122 123 125 126 126 128 128 130 130 130
Publishing Your Site to the Internet . . . . . . . . . . . . . . . . . . . . .
131
FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FTP from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FTP in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting and Putting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Synchronizing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Versioning and Source Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check In/Check Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft Visual SourceSafe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WebDAV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other FTP Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
132 133 139 139 141 142 142 143 144 145 145 146
Part II Web Site Design and Construction
7
Designing and Planning Your Site . . . . . . . . . . . . . . . . . . . . . .
149
Planning and Designing Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Purpose and Goal of the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Target Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Tools and Platforms Available to You . . . . . . . . . . . . . . . . . . . The Site’s Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Navigation Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Development Time and Cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
150 150 153 154 154 155 156
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:59 AM
ix
Color profile: Generic CMYK printer profile Composite Default screen Complete
x
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
8
9
Design Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
157 157 158 159 159
Defining Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
161
Choosing the Server Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Choosing Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft SQL Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Managing Site Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining a New Site with the Site Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining a New Site in Advanced View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Local Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Remote Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check-in/Check-out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cloaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Site Map Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File View Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preplanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Site Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Synchronizing the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding New Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a Database to the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Up Data Sources for the Site . . . . . . . . . . . . . . . . . . . . . . . . . Other Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Site-Wide Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Find In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Search For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specific Tag: Using the Tag Replace Functionality . . . . . . . . . . . . Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Find/Replace Source Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Open and Save Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
162 162 163 164 165 165 165 166 167 167 168 168 169 169 169 172 172 178 178 179 182 183 185 185 187 187 189 189 190 191 191 192 192 194 195 195 196 196 197 198 200 200
Advanced Page Design Tools . . . . . . . . . . . . . . . . . . . . . . . . . .
201
Advanced Template Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
202
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:59 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
10
11
12
Nested Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optional Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeating Regions and Repeating Tables . . . . . . . . . . . . . . . . . . . . Editable Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Template Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Tag Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Code View Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Target Browser Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Link Checker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
202 203 204 204 206 217 217 221 223 225 228 228 231 231
Fireworks MX Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
233
Quick Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reconstitute Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Image Placeholders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing from Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pop-Up Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optimizing Graphics for the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File Formats for the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Slicing Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optimizing a Complex Image in Fireworks . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
234 235 237 238 239 243 243 244 245 252
Flash Integration Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
253
SWF Files in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flash Properties and the Property Inspector . . . . . . . . . . . . . . . . . . Flash Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flash Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flash Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flash Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Generator Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shockwave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controlling a Flash or Shockwave Movie . . . . . . . . . . . . . . . . . . . . . . . . . . . . Built-In Dreamweaver Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . The JavaScript Integration Kit for Flash 5 . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
255 256 259 260 261 263 264 265 265 265 266 267 267 270
Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
271
Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nested Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CSS Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applying Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Embedded Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inline Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
272 273 273 274 275 275 275 276
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:58:59 AM
xi
Color profile: Generic CMYK printer profile Composite Default screen Complete
xii
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
13
Applying CSS Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cascading Your Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cascading Style Sheets in Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . Creating a New Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attaching a Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applying and Editing a Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver MX’s CSS Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
276 277 277 277 287 288 290 291
JavaScript and DHTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
293
HTML, CSS, JavaScript, and the DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . History of JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Language Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Behavior Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a Behavior to a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Third-Party Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a Timeline in Your Page . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a Behavior to a Timeline . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting and Stopping Timelines . . . . . . . . . . . . . . . . . . . . . . . . . . . Automating Path Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timeline Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JavaScript Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
294 295 296 301 304 304 308 331 331 331 332 332 332 333 333 335
Part III An Introduction to Web Scripting
14
15
Developing a Web Application . . . . . . . . . . . . . . . . . . . . . . . . .
339
HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CGI Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Scripting Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Problem with CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML Templating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.Net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
340 343 343 344 345 345 345 346 347 347 347 348 348 348
Active Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
349
Active Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Client/Server Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
350 351 353
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:00 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
16
17
The ASP Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Request Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Response Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Session Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Server Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ObjectContext Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . global.asa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
354 354 364 372 375 375 376 376 379 380 382 383 384
Java Server Pages in the Dreamweaver MX Environment . .
385
The JSP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Java Programming Language in JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables in Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Structures in Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JSP Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The request Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The response Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The out Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The session Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The config Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The page Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The pageContext Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The exception Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The page Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The include Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The taglib Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Serving the JSP Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using JSP with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The JSP Insert Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Bindings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Server Behaviors Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Components Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Tag Libraries in Dreamweaver MX . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
386 387 388 390 392 394 395 397 398 398 400 401 401 401 401 402 402 406 406 407 410 410 411 418 419 421 423
.........................................
425
The ColdFusion Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CFML: The ColdFusion Programming Language . . . . . . . . . . . . . . . . . . . . . ColdFusion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Variable Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Pound Signs in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing the ColdFusion Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ColdFusion
427 428 431 433 434 436 441
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:00 AM
xiii
Color profile: Generic CMYK printer profile Composite Default screen Complete
xiv
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
18
19
The ColdFusion Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing the Functionality of the Administrator . . . . . . . . . . . . . Learning the CFML Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Core ColdFusion Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CFScript and Its Use in Dreamweaver MX . . . . . . . . . . . . . . . . . . . Advanced ColdFusion Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion and Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ColdFusion Bindings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Server Behaviors Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Code Generation in Dreamweaver MX . . . . . . . . . . . ColdFusion MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CFC: ColdFusion Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XML Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
444 444 450 450 458 461 469 469 474 478 478 479 479 482 485 486 487
PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
489
The PHP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing the Windows CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Building a Linux Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The PHP Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Templating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Request Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . New Methods of Referencing Variables . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Structures in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Built-In Functions in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sending E-Mail with PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using PHP with MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using PHP with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . History of PHP in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . The Bindings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Server Behaviors Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
490 490 500 505 505 506 508 509 511 511 513 514 516 519 525 526 529 529 530 532 534 535
ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
537
Moving from ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Differences Between ASP and ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Structural Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specific Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The BIN Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The PageLoad Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
538 539 540 540 542 545 545 545 545
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:01 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
PostBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VB.NET or C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver’s .NET Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Your Support Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
546 546 546 546 547 548 549 549 550 551
Part IV Adding Database Features to Your Site
20
21
Making a Database Connection . . . . . . . . . . . . . . . . . . . . . . . .
555
History of Dreamweaver Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Database Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Types of Dreamweaver MX Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion 4 and 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JDBC Connections for JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting the JDBC Drivers into Dreamweaver MX . . . . . . . . . . . . . Macintosh Database Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Making a Successful Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
556 556 558 559 559 570 572 577 579 583 586 587 588 589
Designing a Relational Database . . . . . . . . . . . . . . . . . . . . . . .
591
What Is a Database? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Database Management System . . . . . . . . . . . . . . . . . . . . . . . . . The Individual Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Designing a Relational Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use of the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Uniqueness and Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Candidate Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Primary Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Foreign Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . One-to-One Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . One-to-Many Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Many-to-Many Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
592 593 595 596 597 598 599 600 600 600 601 605 605 606 607 607 609 609 609 609
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:01 AM
xv
Color profile: Generic CMYK printer profile Composite Default screen Complete
xvi
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
22
23
24
Database Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
609 610
Setting Up Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
611
OLTP and OLAP Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . List the Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Normalizing the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Typical Uses for the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementing the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Remote Access Databases on Windows NT and Windows 2000 . . Database Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
612 612 613 613 622 627 628 632 632 636 637
An Overview of the Structured Query Language . . . . . . . . .
639
Basic SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions and Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Count Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Sum Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Avg Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Min and Max Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Order By Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Group By Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inner Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outer Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The In Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Embedded Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Action Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Insert Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Update Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
640 642 645 645 648 649 651 651 652 653 653 654 654 655 656 657 657 659 660 660 661 663 663 664 664 664 665 665 666 667
Adding Database Features to Your Site . . . . . . . . . . . . . . . . . .
669
Defining the Database Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Recordset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Displaying the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
670 672 673 675
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:01 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
25
Using the Dynamic Table Application Object . . . . . . . . . . . . . . . . Sorting the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigating Through the Recordset . . . . . . . . . . . . . . . . . . . . . . . . . Displaying the Record Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . Master-Detail Page Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the Recordset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the Insert Master Detail Application Object . . . . . . . . . . . The Repeat Region Server Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Repeating HTML Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simple Stored Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modifying the Display Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Record Insertion Form Application Object . . . . . . . . . . . . . . . . . . . . . . . Adding Administrator Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Uses of the Bindings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
676 677 678 679 679 679 682 685 686 699 700 701 703 704 707 708
User Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
709
Session Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a Validate Form Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting a Custom JavaScript Function . . . . . . . . . . . . . . . . . . . . . Testing for a Duplicate Username . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the failed_new_user and login_user Pages . . . . . . . . . . . Server-Side Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP/VBScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP/JScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Restrict Access to Page Server Behavior . . . . . . . . . . . . . . . . . . . . . . . . . Log Out User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting to the Database Using a Recordset Field . . . . . . . . . . . . . . . . . . . . . . Writing the SQL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the Company Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The my_company Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inserting Company Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
710 712 712 716 717 724 724 726 726 727 728 729 730 733 735 737 741 741 741 744
Part V Advanced Data Integration
26
Advanced Database Features . . . . . . . . . . . . . . . . . . . . . . . . . .
747
Search Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Basic Search Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Advanced Search Features . . . . . . . . . . . . . . . . . . . . . . . . . Adding Multiple Search Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the my_company and find_a_seeker Pages . . . . . . . . . . . . . . . . . . . Adding a Resumes Viewed Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hand-Coding a Session Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Conditional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
748 748 752 755 767 768 769 770
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:02 AM
xvii
Color profile: Generic CMYK printer profile Composite Default screen Complete
xviii
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
27
28
29
Adding a resumes_viewed Page to the Admin Section . . . . . . . . . . . . . . . . Using Count(*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the Error Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
772 772 775 776
Advanced Scripting Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . .
777
E-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CDO Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JMail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other ASP E-mail Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .NET Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controlling Where Script Is Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The FileSystemObject Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Debugging and Troubleshooting Common Errors . . . . . . . . . . . . . . . . . . . . Debugging Server-Side ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
778 778 780 780 781 783 785 785 787 790 791 792 796 798
Server-Side Flash Integration . . . . . . . . . . . . . . . . . . . . . . . . . .
799
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UI Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UI Components Set 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Charting Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Dreamweaver for ActionScript Programming . . . . . . . . . . . . . . . . . . Using Get and Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Flash Remoting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the ColdFusion Component . . . . . . . . . . . . . . . . . . . . . . . Adding the Flash ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Server-Side ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
801 801 803 804 805 805 806 810 815 818 819 821 826 827
E-Commerce with Dreamweaver MX . . . . . . . . . . . . . . . . . . .
829
The Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The UltraDev Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UltraCart II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Intellicart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Charon Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cartweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other E-Store Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Elements of the E-Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Cart Server Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Cart Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Database Structure and Other General Database Issues . . . . The Database for the Acme Databases Site . . . . . . . . . . . . . . . . . . . The Site Tree for Acme Databases . . . . . . . . . . . . . . . . . . . . . . . . . . The About Us Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
830 831 831 832 832 834 836 836 837 838 838 840 848 852
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:02 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Contents
The Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The SignUp Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementing the Products Page and Detail Page . . . . . . . . . . . . . The Cart and Empty Cart Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Check Out Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Download Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Error Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-Mailing the Customer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Few Notes About Scaling the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
852 853 855 858 861 863 863 864 865 865
Part VI Getting the Most Out of Dreamweaver MX
30
31
Extensions and the Extension Manager . . . . . . . . . . . . . . . . . .
869
What Is an Extension? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extension Packages and the Extension Manager . . . . . . . . . . . . . . . . . . . . . . The Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Macromedia Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Extension Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tips for Using Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some Popular Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Built-In Command Maker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
870 874 874 876 876 879 880 881 882 892 893
Dreamweaver MX Extensibility Model . . . . . . . . . . . . . . . . . .
895
Understanding Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Extension Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selections and Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dot Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Dreamweaver MX API Methods . . . . . . . . . . . . . . . . . . . . . . . . Shared Folder Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modifying an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Object Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The objectTag() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Display Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Server Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Floaters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packaging Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Main Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Products and Authors Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description of the Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
896 898 900 902 904 905 907 915 920 921 922 923 930 931 942 945 947 951 956 962 962 963 964
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:02 AM
xix
Color profile: Generic CMYK printer profile Composite Default screen Complete
xx
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
32
Putting Your Files into the Extension Package . . . . . . . . . . . . . . . . Changing the Dreamweaver Menus . . . . . . . . . . . . . . . . . . . . . . . . Wrapping Up the Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
964 965 966 967
Building Server Behavior Extensions . . . . . . . . . . . . . . . . . . . .
969
Steps for Building a Server Behavior Extension . . . . . . . . . . . . . . . . . . . . . . . Your Final Code: The First Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the HTML File: The Interface . . . . . . . . . . . . . . . . . . . . . . Adding Your Include Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Global Variables and Implementing the initializeUI() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Search String: Finding the Behavior in Your Document . . . . Creating Group and Participant XML Files . . . . . . . . . . . . . . . . . . Building Your PATT and MASK Variables . . . . . . . . . . . . . . . . . . . Writing the Function Skeletons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementing the canApplyServerBehavior() Function . . . . . . . . . . Implementing the findServerBehaviors() Function . . . . . . . . . . . . . . Implementing the applyServerBehavior() Function . . . . . . . . . . . . . Implementing the inspectServerBehavior Function . . . . . . . . . . . . . Cleaning Up: the analyzeServerBehavior Function . . . . . . . . . . . . . . Implementing the deleteServerBehavior Function . . . . . . . . . . . . . . Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Where Do You Go from Here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: Using the Server Behavior Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Server Behavior with the Builder . . . . . . . . . . . . . . . . . Creating a Server Behavior with More Than One Participant . . . . . Creating a Translator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Where Do You Keep Your Server Behaviors? . . . . . . . . . . . . . . . . . . . . . . . . Extending the Server Behavior Builder (SBB) . . . . . . . . . . . . . . . . . . . . . . . . . Extending the Server Behavior Template . . . . . . . . . . . . . . . . . . . . Adding Custom Server Behavior Builder Controls . . . . . . . . . . . . Server Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Few Last Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
974 975 977 978
Index
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:03 AM
978 979 980 982 992 993 994 994 995 996 996 997 998 998 999 1009 1010 1016 1017 1017 1019 1021 1022 1022
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter FM:xxi
Foreword ne Tool.” That’s the phrase we used around here at Macromedia to define the idea of combining the best of Dreamweaver, UltraDev, ColdFusion Studio, and HomeSite into a single product. The reasoning behind it is pretty clear if you look back to where we were just one year ago. If you took a look at the Web development tool selection from Macromedia after the merger with Allaire, things were a bit confusing, to say the least. We offered nine different stand-alone products and “Studios” for HTML and Web application development. All of these products made perfect sense given the climate they were developed in, and the customer sets they intended to serve. But it turns out that Web development had changed by the time all these products came under the Macromedia banner, and it was time for Macromedia to build a tool that reacted to that change. In speaking with Web developers about where they saw the future of Web development, three central themes emerged pretty quickly: accessibility, maintainability, and reusability. Accessibility is not just about building sites to be Section 508, or W3C level 2 compliant; it’s about centering Web development efforts around the goals of the user, rather than the goals of the company. The user experience on the Web was stagnating—everything was still too hard, whether accessing the Web with a keyboard and a mouse, or with a screenreader and touch pad. Something had to be done to make Web sites more usable.
“O
xxi Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:03 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
xxii
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
Maintainability came through in the cries of Web developers to start building sites in standard ways, using standard technologies. It was no longer about having the hippest, coolest Web site built using whatever quirky coding techniques the nose-pierced, tattooed Web developer decided to implement. Adult supervision has finally come to Web development, and people want sites built in standard ways so that they can be developed in a straightforward manner and passed on to teams who can maintain them without ripping them apart to see what’s going on. The idea of reusable frameworks and components has existed in the world of software development for years, but it has just recently been brought to the Web development arena. When we set out to build a new version of Dreamweaver, for example, we don’t throw out the old version and start over, we build on top of what we already have. Most major Web sites fail to do this, however. How many times have you seen a Web site completely rebuilt from the ground up simply because the requirements of the site outgrew the technology with which it was built? Finally, with technologies like J2EE, .NET, and Web services, developers have frameworks around which they can build their sites so that they don’t have to start all over every time a new requirement is added, or a new corporate strategy is chosen. Clearly, Web development is entering a new era, and it is time for a new tool to step up to the plate and provide a complete development environment for building professional sites. Dreamweaver MX is our attempt to do just that. Try as we might, though, we rarely seem to get things correct on the first try, and a lot of credit for Dreamweaver MX has to go to users like Ray and Tom for their patience and help throughout the development cycle. Having a perspective from people like Ray and Tom, who have to both use the product and explain it to all sorts of users, was invaluable to us as we went from planning to beta to the final release you see before you. Ray and Tom should stand up and take a good deal of credit for this release, and I’m sure this volume of the Complete Reference will be a welcome addition to the library of both seasoned veterans and those new to the Dreamweaver world. I welcome all of you to this release of Dreamweaver, and hope that you’ll continue to send us your feedback and requests so that the next version will be even better. David Deming Product Manager, Dreamweaver Macromedia
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:03 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter FM:xxiii
Acknowledgments he longer we do this, the longer the list of people we need to thank gets. We are truly appreciative of everyone in the Dreamweaver community who has been so supportive of the things we have done. We hope that we continue to live up to your expectations. We have received a tremendous amount of support from the folks at Macromedia: Matt Brown, Dave Deming, Tom Hale, Susan Morrow, Susan Marshall, Mike Downey, and, of course, Sho, Randy, Sam, Lori, and the rest of the development team. At Osborne, we could not do this without Jim Schachterle, Tim Madrid, Jenny Malnick, Wendy Rinaldi, and Sherry Bonelli. Tom continues to amaze me with how adept he is at learning new things and explaining them clearly. I wish everyone could find such a partner. You could all do great things. And thank you mostly to my wife, Susan, and our son, Caleb. I hope you are half as proud of me as I am of the two of you. —Ray
T
xxiii Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:03 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
xxiv
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
The writing process is a collaborative effort and, as such, many hard-working and supportive individuals need to be acknowledged. Thanks to everyone at Osborne for being so helpful in making the book-writing and publishing process go so smoothly, especially Jenny, Jim, and Tim. My partner Ray provides the perfect complement to my writing. The book you see in front of you is a combined effort that makes this reference complete. Ray’s initiative and enthusiasm for new projects keeps us thriving. Thanks, Ray! Massimo is the man when it comes to Dreamweaver, and he provides excellent technical advice throughout the writing process. He is also a good friend and a guiding light for the Dreamweaver community. Thanks, Massimo! Everyone at Macromedia has been very supportive of our efforts. The engineers especially deserve a round of applause for delivering the greatest Dreamweaver version to date. As a Web developer, I find the program simply awesome to work with. As an extension developer, I am excited about all of the advances in the foundation of the program, and the integration with other Macromedia programs. Last, but not least, I have to thank my wife, Janet, who is always a source of inspiration. She provides support and encouragement during my long workdays and often a fresh pair of eyes to edit my chapters. Without her help, none of this would have been possible, and it certainly wouldn’t have been as enjoyable. She gets a thank you and a big kiss. —Tom
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:03 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter FM:xxv
Introduction
elcome to Dreamweaver MX: The Complete Reference. Dreamweaver has grown a lot since the last version. In a nod to the ascendancy of the dynamic site, UltraDev’s features are included and expanded in the core Dreamweaver product. Macromedia now owns ColdFusion and JRun, making them a true contender in the application server market. As a result, we have a ton of new features to come to grips with and new capabilities to exploit in this version. There is a learning curve that comes with this much power, though. The new interfaces can be a bit overwhelming, and the server-side functionality can be confusing to a novice. That is why this book is so important. It gives you all of the tools you need to get started and become productive with Dreamweaver MX—in one package. We hope you enjoy it.
W
xxv Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:04 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
xxvi
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Dreamweaver MX: The Complete Reference
Who Should Read This Book Eighty percent of Web designers use Dreamweaver. If you are in that crowd, you should read this book. There is something in this book that will benefit almost anyone—from beginner to professional—with an interest in Web Development with Macromedia products. If you are a developer, we can show you how to get the most out of Dreamweaver’s tools. If you are not yet a developer, you will do well to become one, as the Web is not standing still, and dynamic, data-driven sites are the future. This book can ease you into that role within the comfort of a product you are used to.
How This Book Should Be Read The short answer is, however you would like to read it. Chapters certainly do build upon each other, and you might find it less confusing to at least thumb through chapters with familiar content, just so you know where we are in the discussion. But you can safely refer to individual chapters for their specific content on most topics. We have tried to play a dual role between traditional reference and tutorial by couching many of our explanations within projects and examples. Hopefully, this approach serves a broad audience well.
What Is In This Book We cover Dreamweaver MX, Fireworks MX, Flash MX, and a bunch of related technologies like ASP, ASP.NET, ColdFusion, SQL, and database design in the pages of this book. It is laid out so that you should be able to locate the parts you are interested in pretty easily, but here is the overview. Part I in an introduction to the basic concepts that make up Dreamweaver. It takes you through the beginnings of a site’s development including much of the graphic layout. Part II covers the design and construction of an entire Web site, including site design, page design, Fireworks integration, Flash, CSS, and Javascript. Part III covers Web scripting using the languages supported in Dreamweaver MX. Part IV picks up with the construction of the Web application and adds data functionality to the site. Part V covers advanced data-driven topics, including data-driven Flash and eCommerce. Part VI is for the adventurous, and covers using and creating extensions for Dreamweaver MX.
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:04 AM
Color profile: Generic CMYK printer profile Composite Default screen Complete
Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Front Matter
Introduction
Conventions Used In This Book We have used several conventions to make this book easier to read. You can identify code listings by their typeface. Here is an example: <% Dim Text Test = “Hello World” Response.Write Text %>
If a line of code needs to be split across two lines, you will see the ¬ character. When you are supposed to press a key or a combination of keys, they will be identified like this: CTRL-F2
Steps that you need to follow will be presented as a numbered list.
Downloads for Examples This book demonstrates several examples using a fictitious site named Bettergig.com. The database, template, stylesheet, and other code for the book are available for download at www.dwteam.com/tcr or by going to www.osborne.com and following the links. Also, a working site showing some of the functionality created in the book is at www.bettergig.com.
Support and Errata We do our best to provide help and errata information at our Web site at www.dwteam.com. Please visit us there and let us know how you liked the book and what else you would like to see. Thanks and enjoy.
P:\010Comp\CompRef8\514-2\fm.vp Wednesday, July 03, 2002 11:59:04 AM
xxvii
This page intentionally left blank.
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1 Blind Folio 1
Part I Getting Started with Dreamweaver MX
Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:25 PM
This page intentionally left blank.
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Chapter 1 And Then There Was One 3
Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:25 PM
Color profile: Generic CMYK printer profile Composite Default screen
4
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Dreamweaver MX: The Complete Reference
e began the last version of this book talking about how fast things move in the Internet world. We had just been hit with a double shot of UltraDev within six months and we were wondering if we could ever write 1,000-page books fast enough for the team at Macromedia. Well, it took a little longer this time—about 18 months in fact. People have been clamoring for news about a new Dreamweaver release for months. Book publishers even had mystery Dreamweaver and UltraDev 5 releases listed at Amazon long before anything would come out of San Francisco. You are about to find out why Macromedia amended its notoriously aggressive release schedule and exactly how worthwhile the wait was. On April 29, 2002, Macromedia made one of the most significant announcements in its history. Three new products were revealed that, along with the Flash release of the previous month, form the core of its new product strategy, called MX. The MX products represent the culmination of the integration of Elemental Software and Allaire into Macromedia’s toolbox with the best suite of Web development and server software available. In fact, they are so well integrated that we cover portions of Fireworks MX, Flash MX, and ColdFusion MX in this book on Dreamweaver MX. Get some coffee; there is a lot to talk about. Revising a title like this is difficult. We were tempted to throw everything out and start over with new examples and new ideas. As we review what has happened in the world of Web development in the last year and a half, there have been some tremendous changes. Microsoft’s .NET platform has been released, and Dreamweaver MX supports it as a server model. Other technologies such as XML have come into their own and are significant parts of the functionality of the databases that are commonly used. New Windows and Macintosh versions have been released and new browsers make cross-platform development even more challenging. Perhaps the biggest change is the market for this book. We were the guys out in safe little UltraDev left field until now. But Macromedia’s decision to combine Dreamweaver and UltraDev into a single Web application platform has forced us into the mainstream, and will force Dreamweaver users everywhere to reckon with these new features. We encourage you to embrace all of the power of this application even if you can’t yet spell PHP. Still, a lot is the same as it was. SQL (Structured Query Language) and database design concepts are essentially the same as they were. Likewise, the core technologies that control the Internet are still in place and have just as much impact on the work you will do as ever. Netscape 4 is still the bane of the modern designer, and millions of Web sites still run good old traditional ASP. This is the complete reference to Dreamweaver MX, just as a dictionary is a complete reference to a language. When you grab a copy of Webster’s to look up “solipsistic,” you may not need the part that defines “cat,” but you still expect it to be there; it’s the dictionary and somebody will likely need it at some point. Likewise, to truly be worthy of the title “Complete Reference,” it is appropriate for us to cover the entire range of Dreamweaver MX and its related technologies. Therefore, we begin at the beginning.
W
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:25 PM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Chapter 1:
And Then There Was One
If you have been working with the Internet for longer than, say, a week, you have no doubt heard some permutation of the following question: “Oh yeah, the Internet—now, who exactly owns that?” Even worse are those that equate it with sex and danger or those that use the terms Internet and AOL interchangeably. It’s easy to roll your eyes and snigger at those less hip than you, but it is often more difficult to clearly articulate exactly what the Internet is and where it came from. There have been several revolutions in world history that changed the way people lived their lives permanently. But none has occurred as quickly, ubiquitously, and nonchalantly as the Internet revolution. The Internet has affected every corner of our culture in profound ways. At home, at school, and at work, our lives are different, if not better, as we move into the Information Age. It has been said that information is power; and if that is true, then we are the most powerful we have ever been. From the theme ingredient on the next episode of Iron Chef, to last-minute income tax filing forms, to the complete text of pending legislation, there is almost nothing you can’t find with just a little effort and access to the World Wide Web. It is interesting that one of the most exciting uses of twenty-first century technology is the exercise of ideals hundreds of years old. Speech and the flow of ideas have never been more free. Our businesses have changed. The bookstore isn’t necessarily down the street anymore—often it is at the other end of a Uniform Resource Locator (URL) such as www.amazon.com or www.bn.com. People who could never have competed with the “big boys” now have all but equal standing and an unprecedented opportunity to market and sell their products. We can communicate as never before. Whether it is parents to their kid in a school across the country, constituents to their representative, or a satisfied (or unsatisfied) customer to the CEO, we are more in touch with the world around us. The handwritten family letter of yesterday is today’s smartly formatted electronic presentation complete with the latest pictures of the grandkids delivered instantly without a stamp. The Internet makes the world smaller than even Mr. Disney imagined. But as with any medium with the potential of the Internet, those who choose to fill it with content bear a certain responsibility. Although the Web is full of sites and pages and words of incredible utility, it is also full of poor design, bad programming, and content of dubious validity. This book aims to help you learn how to use one of the most powerful Web design tools available so that you can make a positive contribution.
The History of the Internet Do you remember Sputnik? The sad fact is, a growing number of computer whizzes weren’t around to personally remember the Bicentennial, This Is Spinal Tap, or the last episode of M*A*S*H, much less the 1957 launch of a little Russian satellite. But that little satellite was the first launched from Earth, and it scared the pants off of the United States military, it being the Cold War and all.
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:26 PM
GETTING STARTED WITH DREAMWEAVER MX
The Internet
5
Color profile: Generic CMYK printer profile Composite Default screen
6
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Dreamweaver MX: The Complete Reference
The next year, the Department of Defense formed the Advanced Research Projects Agency (ARPA) to establish and advance U.S. dominance in military science and technology. By 1965, in its effort to establish efficient communications networks, ARPA had developed the concept of a distributed network, and it sponsored a study on networking time-shared computers. “The Experimental Network” was formed between three computers at ARPA, MIT, and System Development Corporation in California communicating over a 1,200 bps phone line. This led to the initial designs of what would become the ARPANET. Meanwhile, studies were being conducted at several locations regarding a new technology known as packet switching. The concept of packet switching involved the routing of information across distributed networks in small chunks called packets. This would allow for the efficient transfer and recovery of data with “no single outage point,” as Paul Baran put it in 1964. These two paths began to converge in 1968 when ARPA put its design out to bid. Companies were asked to propose methods by which the ARPANET could be constructed and put to use. Bolt Beranek and Newman, Inc. (BBN) was awarded the contract later that year to build Interface Message Processors (IMPs). Construction began in 1969 with 4 IMP nodes connecting computers over 50 Kbps phone lines. The 1970s was an exciting decade, with progress being made on several fronts. As the ARPANET grew, other independent networks appeared that would later be connected to it. 1971 saw the first intermachine messaging, which was expanded onto the ARPANET the following year along with the introduction of the @ symbol in the addressing scheme. Larger configurations of up to 40 machines at a time were demonstrated. In addition, other countries began to develop their own versions of the ARPANET. The Telnet specification was developed in 1972. Two of the most significant events occurred in 1973. The first international connections were made to the ARPANET when the University of London hooked in through NORSAR. And at Harvard, Bob Metcalfe (the eventual founder of 3Com) wrote his Ph.D. thesis describing Ethernet. Ethernet was tested at the Xerox Parc laboratories (eventually responsible for the introduction of the mouse to desktop computing and the inspiration for the LISA, and eventually, the Macintosh interface). Ethernet is still the protocol of choice for thousands of LANs and the Internet in general. The specification for the File Transfer Protocol was developed in 1973. The next several years saw the expansion of the ARPANET, along with the continued development of technologies that would become central to the Internet. In 1974, the Transmission Control Protocol (TCP) specification was published; and in 1975, the first list server was established with a science fiction lovers’ list becoming one of the first mailing lists. Unix to Unix Copy (UUCP) was created in 1976, and 1977 saw the completion of the specification for networked mail. In 1978, TCP was divided into TCP and the Internet Protocol (IP), which remains the communications protocol of today’s Internet. The decade was capped off by the invention of USENET (the system of newsgroups) in 1979 and, perhaps most importantly, the introduction of emoticons (the little emotion indicators :-)) that litter our text communications to this day).
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:26 PM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Chapter 1:
And Then There Was One
The World Wide Web In 1991, a developer named Tim Berners Lee envisioned a means of going beyond the simple back-and-forth transfer of files over UUCP and FTP connections. He wanted a way to actually view files over remote connections in a formatted way that made scientific and technical papers available to research associates across the network. Mr. Berners Lee developed the concept of the World Wide Web, over which files could be viewed. Those files would basically be text files, but they would be marked up with a tag language (a subset of SGML called Hypertext Markup Language, or HTML) that enabled their formatting in a hierarchal way that was appropriate for the technical content he wanted to display. The potential of this new medium was quickly realized. By the next year, the World Bank was online and the term “surfing the Internet” was coined. In 1993, Mosaic (the first real browser) experienced an unbelievable growth rate as more and more people went online for the first time. The Web continued to expand in 1994. More commercial businesses opened for e-business, the first cyber-bank opened, and the first banner ads appeared—.com became the most popular domain extension, followed by .edu for educational institutions.
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:26 PM
GETTING STARTED WITH DREAMWEAVER MX
The early 1980s can be characterized as a time of rapid network creation. Across the world, networks appeared based on many of the specifications of the prior period. As many new networks developed, some of the earliest began to make a migration from independence to cooperation in what was becoming an international network. The years 1983 and 1984 were important. Several things happened in succession during this period that spurred the growth of the Internet. First, in 1983, the Name Server concept was developed, which made it possible for computers to communicate without knowing the exact path to one another across the network. This culminated in the introduction of the Domain Name Service (DNS) in 1984. Also in 1983, connectivity extended to the desktop workstation. This led to the number of Internet hosts breaking 1,000 the next year. In 1987, the number of hosts broke 10,000. In 1988, the communications backbone was upgraded to a T1 (1.544 Mbps) connection, which led to the number of hosts breaking 100,000 in 1989. During the late 1980s, there was some separation between the ARPANET and what was becoming the NSFNET, a commercially supported network. Although TCP/IP was the standard, the Department of Defense decided to go with a competing protocol. By the early 1990s, ARPANET was gone and the Internet was on its way to commercial glory. What the early 1980s were to the technical development of the Internet, the early 1990s were to its raw growth. In 1990, the first commercial dial-up server provider came online. In 1991, the communications backbone was upgraded to a T3 (45 Mbps); and by 1992, the number of hosts broke 1,000,000. In 1993, Internic was created to manage Internet services through contracts with AT&T, Network Solutions, and General Atomics. In each of the successive years, more and more countries established connections to the network, making it a truly worldwide network.
7
Color profile: Generic CMYK printer profile Composite Default screen
8
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Dreamweaver MX: The Complete Reference
If you were around to view content over the Web on pre-Mosaic browsers, you can truly appreciate the exponential growth graphical browsers has spurred. Although some were awed by the ability to FTP into libraries around the world and view simple HTML files in text-based browsers, it took the eye-candy that the graphics-based browsers allowed to make the medium popular with less technically involved users. By 1995, use of the Web surpassed the use of FTP. For the first time, registration authorities began charging to register domain names. One of the most popular technologies became search engines, by which you could find information all over the world. The last five years have seen a myriad of shifts and changes in the landscape of the Internet and the World Wide Web. Technologies such as Java, .NET, online stock brokerage, online banking, Internet phones, MP3, streaming audio and video, and DSL have made the Internet more accessible and made it more worth accessing. What took 30 years to develop has become ubiquitous and universally useful in just over five years. But the core of the Internet is much like electricity. Although the gadgets that we plug in today are fancier that those of yesteryear, they still plug in with a three-prong plug into a copper wire outlet. The Web is certainly a fancier place today than it was even a short time ago, but it still operates on the infrastructure that was developed and introduced over the first three decades of its use.
TCP/IP A key component of that infrastructure is the communications protocol over which the Internet operates. Actually a suite of protocols, TCP/IP is the several-tiered method by which data is packaged and sent across the wires that connect the world’s computers together. It is made up of the Transmission Control Protocol and the Internet Protocol.
Internet Protocol Although IP comes after TCP in the name of the protocol, IP is the communications core that makes the Internet work. You have likely heard of IP addresses, those sets of numbers separated by dots that are assigned to each host computer and domain on the Net. The Internet Protocol utilizes that numbering scheme to determine the path that it should take across the routers and hosts that make up the Internet to reach the destination it is intended for. When you make a connection to a computer somewhere out on the Web, you are, in reality, connecting to any number of other computers and routers that forward your request in the most efficient way they can determine, given the millisecond they have to think about it. If you are interested to see how your requests are being routed, you can use the tracert utility (for Trace Route) from a command prompt on your computer and see the connections, or hops, your request makes as it travels to the destination you provide (see Figure 1-1). Now, given that this is the way that the Internet works, with each request you make being forwarded through a number of stops, consider what must happen when you download a large Web page, or even a 15MB program from a shareware site. Without
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:26 PM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Chapter 1:
And Then There Was One
9 GETTING STARTED WITH DREAMWEAVER MX
Figure 1-1.
Running tracert to www.basic-ultradev.com returns a number of stops along the way.
the IP protocol, it might be necessary for the entire file to be copied to each node along the way until it reached your computer. That could involve as many as 30 or more copies of the same file, depending on where you and your destination site are located. But, thanks to IP, your request and the response for the computer at the other end can be split up into small packets of data that travel easily across the network, following the most efficient path each of them can find. A number of things can affect the route a packet may take across the Internet, including bottlenecks and outages along the way. The capability of IP to dynamically route around these problems is a key factor in the stability of this kind of distributed network. So, consider how you might get a group of friends across town to the movies. Unless one of you owned a bus, you would probably split up into two or more cars, and head off for the theater. Perhaps one of the drivers likes the expressway, another knows a “shortcut,” and a third doesn’t have enough change for the tolls and popcorn and takes the normal route. Three cars are all taking different routes to the same destination, and each is liable to encounter things along the way that might speed their travel (such as no line at the toll booth) or slow them down (such as a wreck along the shortcut). Although each car left one after the other, there is no guarantee in what order or in what timeframe they might arrive at the theatre. One car might not even make it at all.
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:27 PM
Color profile: Generic CMYK printer profile Composite Default screen
10
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Dreamweaver MX: The Complete Reference
To make the point more clearly, suppose you ordered a book from Barnes and Noble, and instead of shipping you the entire book at once, they sent the individual pages by different carriers with no page numbers. When and if you received all of the pages (and how would you know if you did?), you would be hard-pressed to get them back together in an order that might be useful. This is pretty close to what happens to a file that is being transmitted across the network by the IP protocol alone. IP needs some help to make sure that things end up where they belong. That help comes from the Transmission Control Protocol.
Transmission Control Protocol The Transmission Control Protocol (TCP) is like the big stack of envelopes that the shipping clerk at Barnes and Noble would use to send you all of those pages. Each envelope would be numbered in order and would indicate the total number of envelopes in the sequence—for example, 36 of 1,008. Each envelope would also give some indication of what was on the page inside, so you could make sure that you got the right one. Using this scheme, you could receive all of the envelopes, put them back in order, and make sure that you had received what the store meant to send you. Then you could call Barnes and Noble and yell at them for sending you a book in such a stupid way. But that’s the way it has to work on the Web. Each packet created by the IP protocol is packaged up, numbered, and labeled so that the receiving computer knows what to do with it. If the receiving computer is missing any packets, it knows to send back for them from the sending computer. And the TCP information indicates what the packet should contain so that the receiving computer can identify corrupted data. Together, the two protocols within TCP/IP provide the communications basis on which the Internet is built. But it can really only handle the connection between the computers over which the requests and responses of information are sent. Those actual messages are handled by the Hypertext Transfer Protocol.
Hypertext Transfer Protocol There are basically four parts to any transfer of data over a client/server network (which is really what the Internet is). The first and last of these steps are the connection and disconnection of the two communicating computers, which is handled by TCP/IP. Sandwiched in-between is the work of the HTTP protocol (see Figure 1-2). You have probably noticed the “http” that begins most Web addresses. Actually, most browsers now assume the HTTP protocol is being used when you type in an address, so the http:// designation is not strictly necessary. But rest assured, that is exactly what the browser is generating when it makes a request. Most browsers are also capable of sending ftp and news requests. If that is what is intended, the protocol must be specified, or http will be assumed.
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:27 PM
Color profile: Generic CMYK printer profile Composite Default screen
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Chapter 1:
The steps involved in client/server communication
Once a connection is made, a request for data is sent in the form of an address. This might be an IP address, or it could be a fully qualified domain name such as http://www.basic-ultradev.com. That request is routed via TCP/IP to the host computer that can fulfill it, and the response is sent back as an HTTP response to the requesting computer. Once it arrives, the TCP/IP protocol again assists in putting the packets of information together so that it can be used or displayed. How that response is used when it gets back to the requesting computer depends on the content of the information sent. For these discussions, it is assumed that you are requesting the type of content that makes up most of the World Wide Web—HTML content.
Hypertext Markup Language Hypertext Markup Language (HTML) is the foundation of the World Wide Web. It is this set of tags that describes to the client browser how a file should be displayed, and that is the core purpose of the Web: displaying files of information. The earliest HTML documents were just text. Often they were the text of scientific or research projects, and the way in which they were formatted was important. HTML provided a hierarchal means of organizing and displaying information so that it could be viewed in a form that emphasized its structure more than its design. It does so by providing a selection of tags that mark up the raw text in ways that the browser can understand. For instance, you may want to display the raw text file shown in Figure 1-3, so that your fellow scientist can rip you apart for not following standard research guidelines. This file of simple text does not really allow you to organize your content in a way that will have the maximum effect on your colleague and let him know that you really do know how to write a good outline. HTML allows you to insert indicators such as the
P:\010Comp\CompRef8\514-2\ch01.vp Friday, June 28, 2002 2:59:29 PM
11 GETTING STARTED WITH DREAMWEAVER MX
Figure 1-2.
And Then There Was One
Color profile: Generic CMYK printer profile Composite Default screen
12
Complete Reference / Dreamweaver MX: TCR / West, Muck / 9514-2 / Chapter 1
Dreamweaver MX: The Complete Reference
Figure 1-3.
The sample text files viewed in a browser
following directly into the text that tell the browser on the other end how to display the information: