Dreamweaver MX: ®
A Beginner’s Guide
This page intentionally left blank.
Dreamweaver MX: ®
A Beginner’s Guide 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
Copyright © 2003 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-223039-8 The material in this eBook also appears in the print version of this title: 0-07-222366-9
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/0072230398
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.
About the Authors Ray West is coauthor of five books on Dreamweaver and UltraDev, including the best-selling Dreamweaver UltraDev 4: The Complete Reference and its successor, Dreamweaver MX: The Complete Reference. He is the Vice President and CIO of Workable Solutions, a company specializing in the Web-based administration of health-care alliances. Ray is also the publisher of MX inSite magazine and the founder of TODCON: The Other Dreamweaver Conference. Ray is a founding member of the Dreamweaver Team (www.dwteam.com) and the founder of Community MX (www.communitymx.com). Tom Muck is coauthor of five Macromedia-related books including Dreamweaver UltraDev 4: The Complete Reference and Dreamweaver MX: The Complete Reference. He is an extensibility expert focused on the integration of Macromedia Web development tools with server-side 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 also runs the Basic-UltraDev site with coauthor Ray West (www.basic-ultradev.com) and is a founding member of the Dreamweaver Team (www.dwteam.com).
About the Technical Editor Massimo Foti began using Dreamweaver on the very day the first beta was available, and he has used Dreamweaver ever since. He has been a prolific extension developer since the pioneering days of Dreamweaver 1. He is the creator of www.massimocorner.com, and is a winner of the Macromedia Best Extension Developer award in 2000. His extensions are featured on the Macromedia Exchange for Dreamweaver and have been included in many books and magazines. Massimo works at www.amila.ch developing database-driven Web sites using ColdFusion, PHP, and different kinds of databases. An avid reader of computer books, he works as tech editor, contributor, and reviewer for Osborne, New Riders, O’Reilly, and other publishers.
This page intentionally left blank.
Contents at a Glance PART I
Get Started with Dreamweaver MX 1 Dreamweaver MX: Your Connection to the Internet . . . . . . . . . . . . . . . . . . . . .
3
2 The Dreamweaver MX Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41
3 Creating a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
75
4 Creating a Web Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5 Adding Content to Your Site
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
PART II
Creating Web Applications With Dreamweaver MX 6 Planning the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 7 Essential Language Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 8 Creating a Database
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
9 Choosing Your Database and Connecting to It . . . . . . . . . . . . . . . . . . . . . . . . . . 253 10 A SQL Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
vii Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
viii
Dreamweaver MX: A Beginner’s Guide
PART III
Working with Your Data 11 Displaying Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 12 Searching Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 13 Recordset Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 14 Creating Dynamic Form Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
15 Inserting, Updating, and Deleting Data
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
16 User Registration, Login, and Site Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 PART IV
Adding Advanced Features to Your Site 17 Extensions and the Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 18 Troubleshooting Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 PART V
Appendixes A Mastery Check Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 B Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
For more information about this title, click here.
Contents ACKNOWLEDGMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii PART I
Get Started with Dreamweaver MX 1 Dreamweaver MX: Your Connection to the Internet . . . . . . . . . . . . . . . . . . . . . Critical Skill 1.1 Understand the Internet and the World Wide Web . . . . . . . . . . . . . . The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The World Wide Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TCP/IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hypertext Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hypertext Markup Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 1.2 Understand Data-Driven Web Application Components . . . . . . . . . Critical Skill 1.3 Install Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Application Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Data Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Staging Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Live Data Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ix Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
3 4 4 5 6 7 9 10 12 14 14 16 16 16 17
x
Dreamweaver MX: A Beginner’s Guide
Critical Skill 1.4 Choose Server Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Active Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP on Non-Microsoft Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP Scripting Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Java Server Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 1.5 Install and Configure Microsoft Internet Information Services . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 1-1 Installing and Using Internet Information Services . . . . . . . . . . . . . . . . Critical Skill 1.6 Understand the Components of an IIS Installation . . . . . . . . . . . . . . The Default FTP Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Default Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Default SMTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 1 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17 18 18 19 20 20 20 21 21 22 23 29 29 32 35 38 38
2 The Dreamweaver MX Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.1 Learn to Work with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.2 Use the Site Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.3 Work in the Document Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Tag Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Window Size Pop-Up Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Download Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.4 Organize Your Workspace with the Dreamweaver Panels . . . . . . . . Critical Skill 2.5 Learn Dreamweaver’s Menu System . . . . . . . . . . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.6 Learn About Dreamweaver MX Objects . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 2.7 Learn About Dreamweaver MX Behaviors . . . . . . . . . . . . . . . . . . . . Critical Skill 2.8 Set Your Dreamweaver MX Preferences . . . . . . . . . . . . . . . . . . . . . . Project 2-1 Setting Your Dreamweaver MX Preferences . . . . . . . . . . . . . . . . . . . . .
41 42 42 45 45 47 48 48 51 51 53 54 56 57 58 59 60 61 61 61 65 66 70 71
Contents
What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 2 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72 73
3 Creating a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 3.1 Open, Edit, and Save a Web Page in Dreamweaver MX . . . . . . . . . Naming Your Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing the Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 3.2 Add Text to a Page and Format It . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 3-1 sample.css . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 3.3 Understand the Types of Images Available to the Web Page . . . . . . Relative and Absolute Image Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 3.4 Format and Align Images on the Page . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 3.5 Use Tables to Position Elements on the Page . . . . . . . . . . . . . . . . . . Inserting a Table in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Layout View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Spacer Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Layout View Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nesting Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Layout View Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Customizing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Tables in Code View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 3 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
75 76 77 78 81 84 86 87 89 90 91 92 95 97 99 101 102 103 106 107 108
4 Creating a Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 4.1 Define a New Web Site in Dreamweaver MX . . . . . . . . . . . . . . . . . Project 4-1 Create a Site Definition for eFlea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 4.2 Manage and Add Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . Add New Pages to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding New Directories to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 4.3 Publish Your Site to the Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 4 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
109
5 Adding Content to Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 5.1 Build a Home Page in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . Prepare Your Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create a Simple Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 5-1 Using Dreamweaver to Create Your First Web Page . . . . . . . . . . . . . . . Critical Skill 5.2 Use Fireworks to Design a Page and Use It in Dreamweaver . . . . . . Project 5-2 Creating a More Complex Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
129
110 112 118 119 119 120 127 128 128 130 130 132 133 141 141
xi
xii
Dreamweaver MX: A Beginner’s Guide
Critical Skill 5.3 Create Templates in Dreamweaver . . . . . . . . . . . . . . . . . . . . . . . . . . Identify a Content Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Prepare the Content Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark the Content Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 5.4 Use Templates to Add Pages to Your Site . . . . . . . . . . . . . . . . . . . . . Create the Page from the Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Apply a Template to an Existing Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Drop a Template onto a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 5 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
147 148 148 149 150 150 150 151 151 151
PART II
Creating Web Applications With Dreamweaver MX 6 Planning the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.1 Plan and Design Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.2 Establish the Purpose of the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Focus of the Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How the Site Will Be Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Competition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Target Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.3 Make Basic Site Construction Decisions . . . . . . . . . . . . . . . . . . . . . . The Site’s Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.4 Add Pages to the Site with the Site Map . . . . . . . . . . . . . . . . . . . . . . Site Map Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 6-1 The Site Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.5 Understand Basic Design Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.6 Use Collaborative Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design and Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File View Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 6.7 Use Site-Wide Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Find In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Search For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 6 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
155 156 157 157 158 159 159 159 160 161 162 163 166 167 167 168 169 170 170 171 172 174 175 175 176 176 177
Contents
7 Essential Language Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 7.1 Learn the Basics of ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Request Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Response Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Session Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Server Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ASP Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 7.2 Learn the Basics of JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Java Programming Language in JSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables in Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some Common JSP Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 7.3 Learn the Basics of ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ColdFusion Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CFML: The ColdFusion Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Core ColdFusion Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ColdFusion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Pound Signs in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ColdFusion Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Learn the CFML Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 7.4 Learn the Basics of ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Make the Move from ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Differences Between ASP and ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ASP.NET Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dreamweaver’s .NET Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 7.5 Learn the Basics of PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The PHP Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP Templating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scoping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Built-In Functions in PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP with MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 7-1 Server Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 7 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
179 180 180 182 184 185 185 185 186 188 189 190 190 192 193 195 197 197 198 200 204 205 206 207 207 208 208 212 213 214 215 215 216 216 217 217 219 221 222 222 223
xiii
xiv
Dreamweaver MX: A Beginner’s Guide
8 Creating a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.1 Understand the Basic Database Components . . . . . . . . . . . . . . . . . . The Database Management System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Individual Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.2 Work with Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Date/Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Currency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Autonumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Yes/No . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OLE Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.3 Design a Relational Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Access Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use of the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.4 Integrate Uniqueness and Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Candidate Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Primary Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Foreign Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.5 Know the Different Table Relationships . . . . . . . . . . . . . . . . . . . . . . One-to-One Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . One-to-Many Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Many-to-Many Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 8.6 Use Database Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 8-1 Create the eFlea Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 8 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
225
9 Choosing Your Database and Connecting to It . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 9.1 Learn Background Information on Available Databases . . . . . . . . . . Microsoft Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Microsoft SQL Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
253
226 228 228 230 230 232 232 233 233 233 234 234 234 234 234 235 236 236 237 237 238 238 239 240 241 242 242 242 242 243 244 251 251 254 254 255 257 257 258
Contents
PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 9.2 Make a Database Connection in Dreamweaver MX . . . . . . . . . . . . . Critical Skill 9.3 Make a Database Connection with ASP and ASP.NET . . . . . . . . . . ADO Connection Using ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting to DSNs with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . ADO Connection String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OLE DB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ODBC DSNless Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Microsoft Text Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 9-1 eflea.mdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 9.4 Make a Database Connection with Other Server Models . . . . . . . . . ColdFusion MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JDBC Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Macintosh Database Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting to the Database Server from a Macintosh . . . . . . . . . . . . . . . . . . . . . . Summing Up: The Dreamweaver MX Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 9-2 Connecting to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 9 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
258 259 260 261 261 265 266 267 269 269 270 271 272 274 276 278 279 279 279 281 281
10 A SQL Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.1 Understand Basic SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 10-1 Querying the eFlea Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.2 Learn to Use SQL Expressions and Conditions . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 10-2 Filtering Query Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.3 Learn to Use SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.4 Learn to Use SQL Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Order By Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Group By Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.5 Learn to Use SQL Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
283 284 286 289 294 294 298 299 300 303 303 305 307 308 309 309 311 313 313
xv
xvi
Dreamweaver MX: A Beginner’s Guide
Inner Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outer Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.6 Learn to Use SQL Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The In Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Embedded Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.7 Learn to Use SQL Action Queries . . . . . . . . . . . . . . . . . . . . . . . . . . Insert Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Update Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Delete Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 10.8 Learn to Use SQL Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 10 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
314 314 316 316 317 317 317 318 318 319 320 321
PART III
Working with Your Data 11 Displaying Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 11.1 Create Recordsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 11-1 Creating a Recordset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 11.2 Display Data on Your Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Drag and Drop Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Move To Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 11.3 Display Multiple Records with Repeat Region . . . . . . . . . . . . . . . . Project 11-2 Displaying More Than One Record at a Time . . . . . . . . . . . . . . . . . . . Critical Skill 11.4 Use Live Data View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 11 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
325
12 Searching Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 12.1 Learn the Principles Behind Searching a Database . . . . . . . . . . . . . Form Fields and Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 12-1 search.htm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 12.2 Create a Simple Search Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 12-2 Results.asp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 12.3 Validate Form Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JavaScript Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server-Side Validation Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Validating Using Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 12.4 Search a Database with Multiple Search Criteria . . . . . . . . . . . . . . Project 12-3 search.htm and results.asp Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . .
343
326 326 331 332 332 335 335 339 339 341 341 344 345 349 351 354 358 358 359 361 361 362
Contents
Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 Module 12 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 13 Recordset Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 13.1 Create Pages with Repeat Region and Recordset Paging Server Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Recordset Paging Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Show Region Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 13-1 results.asp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 13.2 Add Recordset Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 13.3 Use the Show Region Server Behaviors on Search Results . . . . . . Critical Skill 13.4 Create a Master-Detail Page Set . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 13-2 details.asp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 13.5 Use Application Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Recordset Navigation Bar Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . Recordset Navigation Status Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . Master-Detail Page Set Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 13 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
367
14 Creating Dynamic Form Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 14.1 Bind Data to Text Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hidden Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 14.2 Bind Data to Radio Buttons and Check Boxes . . . . . . . . . . . . . . . . Radio Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 14.3 Bind Data to List Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 14-1 Binding a Page of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 14 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
389
15 Inserting, Updating, and Deleting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 15.1 Insert New Record in Your Database . . . . . . . . . . . . . . . . . . . . . . . Project 15-1 Inserting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask The Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 15-2 Inserting Data with More Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 15.2 Update Data in Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 15-3 Updating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
407
368 368 370 371 373 374 375 378 381 382 382 383 386 386 387 390 390 396 397 397 399 401 402 406 406 408 408 412 413 418 418
xvii
xviii
Dreamweaver MX: A Beginner’s Guide
Critical Skill 15.3 Delete Data from Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 Module 15 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 16 User Registration, Login, and Site Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 16.1 Understand the Concepts of User Logins and Sessions . . . . . . . . . . Critical Skill 16.2 Set Up a Form to Insert a New User . . . . . . . . . . . . . . . . . . . . . . . . Adding a Validate Form Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding the Insert Server Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing for a Duplicate Username . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Where to Send Failed Attempts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 16.3 Create a Login Form to Log In a User . . . . . . . . . . . . . . . . . . . . . . . Project 16-1 register.asp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 16.4 Implement Page Access Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 16.5 Log Out a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 16 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
423 425 426 426 427 428 429 430 432 434 436 437 438 438
PART IV
Adding Advanced Features to Your Site 17 Extensions and the Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 17.1 Add Functionality to Dreamweaver MX with Extensions . . . . . . . . Dreamweaver MX Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 17.2 Use the Extension Manager That Comes Packaged with Dreamweaver MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 17.3 Download New Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 17-1 Horizontal Looper Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 17.4 Use the Server Behavior Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . Access the Server Behavior Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create a New Server Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 17-2 Create a Server Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Macromedia Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ask the Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 17 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
441 442 443 445 446 448 448 448 450 450 451 452 457 461 461 462
Contents
18 Troubleshooting Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 18.1 Recognize Common Server Errors . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 18.2 Debug Server-Side ASP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 18.3 Recognize Common Coding Errors . . . . . . . . . . . . . . . . . . . . . . . . . Errors Come in Many Shapes and Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some Debugging Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Critical Skill 18.4 Avoid Common Coding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project 18-1 Learning to Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Take Away from This Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Module 18 Mastery Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
463 464 468 470 470 471 473 474 478 478
PART V
Appendixes A Mastery Check Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 B Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Studio MX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Magazines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
501 502 502 502 503 503 504
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
xix
This page intentionally left blank.
Acknowledgments Ray’s Acknowledgments There have gotten to be too many people to thank as we continue to try and keep up with the production cycle at Macromedia. We will always forget someone, but that doesn’t mean you aren’t appreciated. Thanks to everyone at Macromedia, especially Matt Brown, Dave Deming, Tom Hale, Niamh O’Byrne, Jessica Kutash, Susan Morrow, and Susan Marshall. Thanks to the team at Osborne, who makes it possible for us to stay on track. My thanks always to Tom, who keeps us doing cool stuff. And mostly thanks to my family, who has been an unending supply of help and support.
Tom’s Acknowledgments This is our fifth book for Osborne about Dreamweaver, and the list of people to thank seems to grow each time. As always, the staff at Osborne has proven to be a big help during the entire process—Jenny is always right there with a foot in our behinds to keep us motivated. Thanks to Megg and Tana, and to Jim and Tim for getting the ball rolling. Also, good luck to Jim and Tim on your future endeavors! Macromedia has given us much support over the years, and continues to do so. Thanks to everyone at MM, especially Matt Brown and David Deming.
xxi Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
xxii
Dreamweaver MX: A Beginner’s Guide
Thanks to our tech editor, Massimo, who has edited all of our books and is one of the most respected names in the Dreamweaver community. My daughter, Amber, has been a constant inspiration to me. She’s getting to the age where she’ll be learning these programs and teaching me how to use them. Finally, my wife, Janet, is always supportive of my extracurricular activities. She is the best person I know and the reason why I wake up in the morning. Thank you, Janet, for everything you’ve done for me.
Introduction A
lot has changed in the year and a half since we wrote the first edition of this book, Dreamweaver UltraDev: A Beginner’s Guide. The UltraDev program was completely folded into the Dreamweaver family, and now there is just one program: Dreamweaver MX. This new program is vastly more complex than any previous Web development environment that has come before it. This book shows you from start to finish how to build a simple Web application using Dreamweaver MX. Despite its complexities, Dreamweaver MX is also vastly easier to use than its predecessor. That is due, in part, to the new interface the program sports. Dreamweaver MX has taken the best features of some of the other Web development software that has been developed or acquired by Macromedia, including Drumbeat 2000, Dreamweaver, UltraDev, Homesite, and CF Studio. This is a book for beginners, and as such we will attempt to cover the necessities and building blocks. We will also try to move along at a quick pace, so that by the end of the book you will have an understanding of dynamic Web site creation using Dreamweaver MX.
Who Should Buy This Book Anyone who is interested in building Web sites and is coming in with no prior knowledge will find this book to be a necessity. We do, however, make a few assumptions about you: ●
You are familiar with basic Windows or Macintosh file manipulation.
●
You have access to an application server and Web server, such as Personal Web Server or IIS.
●
You have access to a database application, such as MS Access, mySQL, or MS SQL Server.
xxiii Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
xxiv
Dreamweaver MX: A Beginner’s Guide
Conventions Used In This Book The following conventions are used in the writing of this book. Code references use the following monospaced font: var strName = "Bob"
Sometimes code that is supposed to be on one line gets broken up because of the width of the page. In that case there will be a continuation character indicating that you should enter the code on one line. That character looks like this: ¬
When you are supposed to press keys, they will be represented like this: CTRL-F10
Every attempt has been made to ensure that the code listings and content in the book are accurate. If you find any mistakes, please drop us a line so that we can correct future versions. Also, the code used in the book is available for download from www.osborne.com. The best way to go through the tutorials in the book, however, is to download the database used in the book and create your own files that interact with that database. Most of the examples use the built-in features of Dreamweaver and won’t require any coding. To really understand Web site creation, however, you will need to create your own. Do the exercises in each chapter; when you are finished with the book you will need to learn more about all of the different technologies used in Web site creation.
Special Features Each module includes Notes, Tips, and Cautions to provide additional information wherever needed. You’ll also find Ask the Expert boxes—question-and-answer sections to address potentially confusing issues—as well as step-by-step Projects to give you a chance to practice the concepts you’ve learned. Progress Checks also test what you’ve learned along the way. Mastery Checks are included at the end of each module to give you another chance to review the concepts taught in the module. The answers to the Mastery Checks are in Appendix A. We hope that, as you become more proficient in Dreamweaver and want to expand your knowledge even more, you’ll seek out our book Dreamweaver MX: The Complete Reference, also by Osborne, which goes into much more detail than we are able to here in the Beginner’s Guide. We have an open-door policy at our Web site—if you have problems with anything you find in our books, you can send us an e-mail and we’ll try to address the problem as quickly as possible. Also, feel free to drop us a line at www.dwteam.com if you have any suggestions.
Part
I
Get Started with Dreamweaver MX
Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
This page intentionally left blank.
Module
1
Dreamweaver MX: Your Connection to the Internet CRITICAL SKILLS 1.1
Understand the Internet and the World Wide Web
1.2
Understand Data-Driven Web Application Components
1.3
Install Dreamweaver MX
1.4
Choose Server Technologies
1.5
Install and Configure Microsoft Internet Information Services
1.6
Understand the Components of an IIS Installation
3 Copyright 2003 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
4
Module 1:
Dreamweaver MX: Your Connection to the Internet
I
have a little story to tell you. I recently had the privilege of taking guitar lessons from one of my all-time favorite players. During our first session, we had a good discussion about my background and my goals. He was insistent that the way to become the best player I could be was to study as if I were going to play for a living as a professional musician, and that meant going back and reviewing the basics. Now, I have had more music theory than anyone should have to endure. I have played professionally on a variety of instruments since my college years. Nevertheless, within the context of the system my teacher developed, this review of the basics has helped my playing immensely. I went through it quickly, but I still picked up pointers that were new or that I had forgotten about. So I say to you, the way to become the best Web developer and Dreamweaver user you can be is to study as if you plan to become a professional, and that includes a review of the basics. If you are an experienced developer and this book was purchased just to learn the particulars of Dreamweaver MX, you will get through this part quickly and may even pick up a few of those pointers. If you are new to Web development, do not believe that you can become accomplished without a solid understanding of the basics. No design tool can substitute for a good grounding in the way the Internet works and the protocols that make it up. Sure, you can skip ahead to the fun part, but it will mean much more to you if you hang around for a few minutes and learn the foundation of the job you want to perform.
CRITICAL SKILL
1.1
Understand the Internet and the World Wide Web You can use Dreamweaver MX to build applications for your company on an intranet, for a kiosk, or even to run from a CD-ROM, but the most popular use is to build sites that run on the Internet; the world-wide network of computers that make information instantly available. In the scheme of things, the Internet is relatively new, but it is getting more powerful as each year passes. Dreamweaver helps you keep up.
The Internet I suppose there was a time when questions went unanswered. A time when you would wake up at 3:00 A.M. wondering about the lyrics to that Styx song and there was nowhere to find the answer. But it is getting harder to remember that time. Somewhere around six or seven years ago, a little-known government research project began to gain popularity with the development of what would become the most useful software ever offered for free. There have been several revolutions in world history that permanently changed the way people lived their lives. 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, 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 Web is built around several key concepts and protocols. These are all interrelated, but serve very different purposes. Without any one of them, the Internet would not work as we know it. You will need to become well acquainted with these concepts and how they fit into the development cycle and the user experience. They are ●
File Transfer Protocol
●
World Wide Web
●
TCP/IP
●
Hypertext Transfer Protocol
●
Hypertext Markup Language
File Transfer Protocol The File Transfer Protocol (FTP) was one of the earliest methods of using the Internet. Its purpose is betrayed by its name: It is used to transfer files from one place to another, or from
5
1 Dreamweaver MX: Your Connection to the Internet
Dreamweaver MX: A Beginner’s Guide
6
Module 1:
Dreamweaver MX: Your Connection to the Internet
one computer to another over a distributed network. Originally, the Internet was used for the sharing of information by researchers and scientists. They would use FTP to transfer entire files of information back and forth. For instance, a researcher might compose notes about his or her current series of experiments. He or she could then upload them via FTP to a common repository where his or her colleagues could download them and comment on them or add to them with their own findings. FTP was a good way to connect users together and allow them to share their computer files. Today, FTP is still one of the most widely used aspects of the Internet. If you have ever downloaded a shareware program or purchased an upgrade online, chances are you used FTP to do it. As a Web developer, you will find yourself using FTP primarily to place and retrieve the files that make up your sites on your remote server. This will make more sense when you understand how a Web site is constructed. As a means of sharing information, FTP has been replaced by a more convenient, more dynamic, more appropriate method: the World Wide Web.
The World Wide Web Just like FTP, the World Wide Web is well deserving of its name. It is truly a worldwide network, and the way it is constructed can best be described as an interconnected web of information that touches its surroundings like the balled-up string of quantum physics fame. You can start surfing at your favorite site and 30 minutes later there is no telling where you will end up. The Web is distinct from FTP, though, and it works very differently. While the purpose of FTP is to allow the transfer of entire files of information, the purpose of the Web is to allow the viewing of the contents of those files without having to download them to your computer. Using the Hypertext Transfer Protocol (HTTP) and the Hypertext Markup Language (HTML), the Web provides an infrastructure that allows the viewing of text content, graphics, images, and even movies and sound in a program called a browser. You are likely familiar with the popular browsers such as Microsoft’s Internet Explorer and Netscape Navigator. These programs are the means by which users connect to the content that is available to them on the Web. The current browser generations are a tremendous improvement over their text-based ancestors. The glitz and flash that they allow the user to experience is a prime reason for the exponential growth in the popularity of the Internet and the World Wide Web. In order to develop the content that will make up your own little corner of the Web, you need to be familiar with the underlying concepts that make it work. These include the ways in which the vast number of computers and programs that make up the Internet communicate with one another, as well as the language of the Web, HTML.
TCP/IP A key component of the infrastructure of the Internet is the communications protocol over which it 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 (for example, 208.43.451.78). The Internet Protocol utilizes that numbering scheme to determine the path 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 (trace route) utility 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).
Figure 1-1 Running tracert to www.basic-ultradev.com returns a number of stops along the way.
7
1 Dreamweaver MX: Your Connection to the Internet
Dreamweaver MX: A Beginner’s Guide
8
Module 1:
Dreamweaver MX: Your Connection to the Internet
Now, given that this is the way 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 the IP protocol, it might be necessary for the entire file to be copied to each node along the way until it reaches 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. 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.
NOTE A number of things can affect the route a packet takes across the Internet, including bottlenecks and outages along the way. The ability of IP to dynamically route around these problems is a key factor in the stability of this kind of distributed network.
Consider how you might get a group of 12 friends across town to the movies. Unless one of you owned a bus, you would probably split up into three cars and head off for the theater. Perhaps one of the drivers likes the expressway, another knows a “shortcut,” and the 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. 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 was useful. This is pretty close to what happens to a file that is being transmitted across a 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 you 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 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 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 (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.
NOTE 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.
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.dwteam.com/. That request is routed via TCP/IP to the host computer that can fulfill it, and the response is
Figure 1-2 The steps involved in client/server communication
9
1 Dreamweaver MX: Your Connection to the Internet
Dreamweaver MX: A Beginner’s Guide
10
Module 1:
Dreamweaver MX: Your Connection to the Internet
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 they 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 a set of tags that describes to the client browser how a file should be displayed, which 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 hierarchical means of organizing and displaying information so it could be viewed in a form
Figure 1-3 The sample text file viewed in a browser
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 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. But 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 or her know that you really do know how to write a good outline. HTML allows you to insert indicators such as the following directly into the text that tell the browser on the other end how to display the information:
My Research This is my research
Topic One
This is what I found when I investigated topic one. I found that all other scientists are idiots
and I should be rich for the finding in Topic Two.
Topic Two
Topic two should really make me rich. It is where I discover a way to convince people that a tax cut means they get to keep more of their own money.
Summary
In summary, all other scientists are idiots. I should be rich.
Thank You