CONTENTS......Page 5
Who this book is for......Page 23
How does this book differ from my previous ones?......Page 24
How this book is organized......Page 25
What this book isn’t......Page 26
A note about versions used......Page 27
Support for this book......Page 28
Layout conventions......Page 30
1 DREAMWEAVER CS3—YOURCREATIVE PARTNER......Page 31
Starting up......Page 33
Creating a new document......Page 34
Setting new document preferences......Page 35
Exploring the workspace......Page 37
Insert bar......Page 39
Document window......Page 41
Saving and sharing customized workspace layouts......Page 44
Temporarily hiding all panels......Page 45
Organizing visual assets with Bridge......Page 46
Renaming files......Page 47
Layers are dead . . . Welcome, AP elements......Page 48
Seeing the impact of CSS changes in real time......Page 50
Improved style sheet management......Page 51
Using visual aids to understand your CSS structure......Page 52
Checking for browser bugs......Page 53
Checking what your page will look like on other media......Page 54
Drawing absolutely positioned elements......Page 55
Layout Mode goes into exile......Page 56
Using the Coding toolbar......Page 57
Setting Code view options......Page 59
Using code hints and auto completion......Page 60
Dynamic too . . .......Page 61
2 BUILDING DYNAMIC SITES WITHAJAX AND PHP......Page 62
Understanding how dynamic pages work......Page 63
Increasing user interactivity with server-side technology......Page 64
Why choose PHP?......Page 66
Understanding the limitations of Ajax......Page 67
Dynamic terminology 101......Page 68
Accessing the Behaviors panel......Page 69
Giving elements a unique identity......Page 74
Removing an id attribute......Page 76
Editing behavior and effect settings......Page 77
Restoring a deleted behavior or effect......Page 79
Exploring Spry effects......Page 80
Appear/Fade......Page 81
Grow/Shrink......Page 82
Highlight......Page 83
Slide......Page 84
Creating a wrapper
for the Slide effect......Page 85
Applying multiple events to a trigger element......Page 87
Comparing how Spry and PHP handle data sets......Page 88
Building PHP sites with Dreamweaver......Page 89
Setting up the File Compare feature......Page 90
Using File Compare......Page 91
Comparing local and remote files......Page 92
Meet Mark of the Web......Page 93
The next step......Page 94
3 GETTING THE WORK ENVIRONMENTREADY......Page 95
Deciding where to test your pages......Page 96
Checking that your remote server supports PHP......Page 97
Choosing which versions to install......Page 98
Choosing individual installation or an all-in-one package......Page 99
Getting Windows to display file name extensions......Page 100
Preparing for installation on Windows Vista......Page 101
Before you begin . . .......Page 102
Checking that port 80 is free......Page 103
Installing Apache on Windows......Page 104
Running the Apache Monitor on Vista......Page 106
Changing startup preferences or disabling Apache......Page 107
Installing PHP on Windows......Page 108
Testing your PHP installation (Windows XP and Vista)......Page 110
Changing the default Apache port......Page 111
Changing the default IIS port......Page 112
Starting and stopping Apache on Mac OS X......Page 114
Upgrading PHP on Mac OS X......Page 115
Checking the location of php.ini......Page 118
Checking PHP Core settings......Page 120
Checking installed extensions......Page 123
Accessing php.ini on Mac OS X......Page 124
Enabling PHP extensions on Windows......Page 126
Overriding default settings with ini_set()......Page 127
Summary......Page 128
4 SETTING UP A PHP SITE......Page 129
Understanding document- and root-relative links......Page 130
Root-relative links......Page 131
Working with virtual hosts......Page 132
Moving the Apache server root on Windows......Page 133
Setting a default file for Apache on Windows......Page 134
Adding a default PHP file to IIS......Page 135
Creating virtual hosts on Apache......Page 136
Registering virtual hosts on Windows......Page 137
Registering virtual hosts on Mac OS X......Page 139
Opening the Site Definition dialog box......Page 141
Telling Dreamweaver where to find local files......Page 143
Telling Dreamweaver how to access your remote server......Page 145
Defining the testing server......Page 147
Selecting options for local testing......Page 148
Selecting options for remote testing......Page 149
Setting up for Spry......Page 151
Testing your PHP site......Page 152
Troubleshooting......Page 154
Setting options for Preview in Browser......Page 155
Managing Dreamweaver sites......Page 157
Now let’s get on with it . . .......Page 158
5 ADDING A TOUCH OF STYLE......Page 159
Avoiding bad habits......Page 160
Stay away from the Property inspector for fonts......Page 161
Creating simple CSS for beginners......Page 162
Introducing the CSS Styles panel......Page 164
Viewing All and Current modes......Page 165
Displaying CSS properties by category......Page 166
Displaying only CSS properties that have been set......Page 167
Adding, editing, and deleting style rules......Page 168
Defining a selector......Page 169
Defining the rule’s properties......Page 170
Exporting rules to a new style sheet......Page 176
Moving rules within a style sheet......Page 178
Moving rules between external style sheets......Page 179
Setting your CSS preferences......Page 180
Creating and editing style rules......Page 181
Setting the default format of style rules......Page 182
Let’s get creative . . .......Page 183
6 CREATING A CSS SITE STRAIGHTOUT OF THE BOX......Page 184
Using a built-in CSS layout......Page 185
Deciding where to locate your style rules......Page 186
Making sure conditional comments are applied......Page 187
Styling a page......Page 188
Inspecting the cascade in Current mode......Page 196
Finishing the layout......Page 198
Removing the CSS comments......Page 202
How was it for you?......Page 204
7 BUILDING SITE NAVIGATION WITHTHE SPRY MENU BAR......Page 205
Examining the structure of a Spry menu bar......Page 207
Looking at the XHTML structure......Page 209
Editing a menu bar......Page 210
Maintaining accessibility with the Spry menu bar......Page 211
Changing colors......Page 212
Adding borders......Page 213
Changing the font......Page 214
To wrap or not to wrap, that is the question . . .......Page 215
Building the navigation structure......Page 217
Customizing the design......Page 220
A mixed blessing......Page 228
8 SPRUCING UP CONTENT WITHSPRY WIDGETS......Page 229
Features common to all Spry widgets......Page 230
Building a tabbed interface......Page 231
Examining the structure of the tabbed panels widget......Page 232
Editing a tabbed panels widget......Page 234
Selecting harmonious colors......Page 238
Converting to vertical tabs......Page 243
Avoiding design problems with tabbed panels......Page 247
Understanding Spry objects......Page 248
Using the accordion widget......Page 249
Examining the structure of an accordion......Page 250
Editing and styling a Spry Accordion......Page 252
Using the object initialization to change accordion defaults......Page 256
Opening an accordion panel from a link......Page 258
Examining the structure of a collapsible panel......Page 259
Editing and styling collapsible panels......Page 261
Opening a collapsible panel from a link......Page 263
Removing a Spry widget......Page 264
Yet more widgets . . .......Page 265
9 BUILDING ONLINE FORMS ANDVALIDATING INPUT......Page 266
Choosing the right page type......Page 267
Creating a PHP page......Page 268
Inserting a form in a page......Page 269
Inserting a form in Code view......Page 270
Adding text input elements......Page 271
Setting properties for text input elements......Page 274
Styling the basic feedback form......Page 276
Understanding the difference between GET and POST......Page 278
Passing information through a hidden field......Page 279
Offering a range of choices with checkboxes......Page 281
Offering a single choice from a drop-down menu......Page 286
Creating a multiple-choice scrollable list......Page 288
Using radio buttons to offer a single choice......Page 291
Inserting a fieldset......Page 293
Doing minimal checks with the Validate Form behavior......Page 294
Using Spry validation widgets for sophisticated checks......Page 296
Understanding the limitations of Spry validation widgets......Page 297
Removing a validation widget......Page 298
Validating a text field with Spry......Page 299
Building your own custom pattern......Page 304
Validating a text area with Spry......Page 305
Validating a checkbox group with Spry......Page 308
Next, let’s move to the server side . . .......Page 311
10 INTRODUCING THE BASICS OF PHP......Page 313
Embedding PHP in a web page......Page 314
Ending commands with a semicolon......Page 315
Assigning values to variables......Page 316
Displaying PHP output......Page 317
Commenting scripts for clarity and debugging......Page 318
Choosing single or double quotation marks......Page 319
Using escape sequences in strings......Page 321
Adding to an existing string......Page 322
Special cases: true, false and null......Page 323
Performing calculations......Page 324
Using arrays to store multiple values......Page 326
Using names to identify array elements......Page 327
Inspecting the contents of an array with print_r()......Page 328
Making decisions......Page 329
The truth according to PHP......Page 330
Using comparisons to make decisions......Page 331
Testing more than one condition......Page 332
Using the conditional operator......Page 334
Loops using while and do . . . while......Page 335
The versatile for loop......Page 336
Looping through arrays with foreach......Page 337
Using functions for preset tasks......Page 338
Understanding PHP error messages......Page 339
Now put it to work . . .......Page 340
11 USING PHP TO PROCESS A FORM......Page 341
Getting information from the server with PHP superglobals......Page 343
Sending email......Page 344
Scripting the feedback form......Page 345
Using Balance Braces......Page 352
Testing the feedback form......Page 353
Getting rid of unwanted backslashes......Page 354
Making sure required fields aren’t blank......Page 357
Preserving user input when a form is incomplete......Page 361
Filtering out potential attacks......Page 364
Safely including the user’s address in email headers......Page 366
Handling multiple-choice form elements......Page 370
Redirecting to another page......Page 375
Time for a breather . . .......Page 376
12 WORKING WITH PHP INCLUDESAND TEMPLATES......Page 377
Introducing the PHP include commands......Page 378
Telling PHP where to find the external file......Page 379
Using site-root-relative links with includes......Page 382
Choosing the right file name extension for include files......Page 383
Displaying XHTML output......Page 384
Avoiding problems with include files......Page 387
Applying styles with Design Time Style Sheets......Page 388
Adding dynamic code to an include......Page 389
Using includes to recycle frequently used PHP code......Page 392
Analyzing the script......Page 394
Building the message body with a generic script......Page 396
Avoiding the “headers already sent” error......Page 402
Using Dreamweaver templates in a PHP site......Page 403
Creating a template......Page 404
Adding editable regions to the master template......Page 405
Creating child pages from a template......Page 407
Choosing the right tool......Page 412
13 SETTING UP MYSQL ANDPHPMYADMIN......Page 413
Introducing MySQL......Page 414
Understanding basic MySQL terminology......Page 415
Deciding whether to enable InnoDB support......Page 416
Changing the default table type on Windows Essentials......Page 422
Using the MySQL monitor on Windows......Page 423
Setting up MySQL on Mac OS X......Page 424
Adding MySQL to your PATH......Page 426
Securing MySQL on Mac OS X......Page 428
Using the MySQL monitor on Windows and Mac......Page 430
Using MySQL with phpMyAdmin......Page 431
Setting up phpMyAdmin on Windows and Mac......Page 432
Launching phpMyAdmin......Page 435
Backup and data transfer......Page 436
Looking ahead . . .......Page 439
14 STORING RECORDSIN A DATABASE......Page 440
Setting up a database in MySQL......Page 441
Creating a local database for testing......Page 442
Granting the necessary user privileges......Page 443
How primary keys work......Page 447
Designing a database table......Page 448
Deciding how many columns to create......Page 449
Choosing the right column type in MySQL......Page 450
Analyzing the form......Page 452
Defining a table in phpMyAdmin......Page 455
Inserting data from the feedback form......Page 457
Troubleshooting the connection......Page 460
Troubleshooting......Page 462
Using server behaviors with site-root-relative links......Page 463
Inspecting the server behavior code......Page 464
Inserting data into SET columns......Page 465
Creating a recordset......Page 468
Displaying individual records......Page 473
Displaying line breaks in text......Page 478
Merging form input with mail processing......Page 480
A great deal achieved......Page 482
15 CONTROLLING ACCESS TOYOUR SITE......Page 483
Creating a user registration system......Page 484
Defining the database table......Page 485
Building the registration form......Page 486
Preserving the integrity of your records......Page 490
Building custom server behaviors......Page 496
Completing the user registration form......Page 499
Updating and deleting user records......Page 503
Adapting the Sticky Text Field server behavior......Page 506
Building the update and delete pages......Page 507
Creating PHP sessions......Page 517
Destroying a session......Page 518
Creating a login system......Page 519
Restricting access to individual pages......Page 521
Logging out users......Page 522
Understanding how Dreamweaver tracks users......Page 523
Redirecting to a personal page after login......Page 525
Feeling more secure?......Page 526
16 WORKING WITH MULTIPLE TABLES......Page 527
Deciding on the best structure......Page 528
Using foreign keys to link records......Page 529
Avoiding orphaned records......Page 531
Defining the database tables......Page 532
Adding an index to a column......Page 533
Defining the foreign key relationship in InnoDB......Page 534
Selecting records from more than one table......Page 538
The four essential SQL commands......Page 542
SELECT......Page 543
INSERT......Page 545
Managing content with multiple tables......Page 546
Inserting new quotations......Page 547
Using a MySQL function and alias to manipulate data......Page 551
Inserting new authors......Page 553
Using variables in a SQL query......Page 554
Updating authors......Page 559
Deleting authors......Page 564
Performing a cascading delete with InnoDB tables......Page 568
Updating quotations......Page 571
Solving the mystery of missing records......Page 572
Deleting quotations......Page 575
What you have achieved......Page 576
17 SEARCHING RECORDS ANDHANDLING DATES......Page 578
Querying a database and displaying the results......Page 579
Displaying the number of search results......Page 580
Creating striped table rows......Page 581
Understanding how Dreamweaver builds a SQL query......Page 583
Troubleshooting SQL queries......Page 586
Setting search criteria......Page 587
Using numerical comparisons......Page 588
Searching within a numerical range......Page 590
Making a search case sensitive......Page 593
Displaying a message when no results are found......Page 594
Searching multiple columns......Page 595
Using wildcard characters in a search......Page 596
Using wildcard characters with numbers......Page 599
Using a FULLTEXT index......Page 602
Solving common problems......Page 605
Reusing a recordset......Page 606
Understanding how a repeat region works......Page 609
Formatting dates and time in MySQL......Page 610
Using DATE_FORMAT() to output user-friendly dates......Page 611
Working with dates in PHP......Page 614
Setting the correct time zone......Page 615
Creating a Unix timestamp......Page 616
Formatting dates in PHP......Page 617
Validating and formatting dates for database input......Page 619
Continuing the search for perfection......Page 622
18 USING XSLT TO DISPLAY LIVE NEWSFEEDS AND XML......Page 623
What an XML document looks like......Page 624
Using HTML entities in XML......Page 626
Checking your server’s support for XSLT......Page 627
Pulling in an RSS news feed......Page 628
How Dreamweaver handles server-side XSLT......Page 629
Using XSLT to access the XML source data......Page 630
Displaying the news feed in a web page......Page 638
Being a bit more adventurous with XSLT......Page 639
Setting up a local XML source......Page 640
Understanding how XSLT is structured......Page 642
Accessing nested repeating elements......Page 643
Testing a single condition......Page 645
Testing alternative conditions......Page 646
Sorting elements......Page 648
Formatting elements......Page 649
Filtering nodes with XPath......Page 650
Using XSLT parameters to filter data......Page 652
More XML to come . . .......Page 656
19 USING SPRY TO DISPLAY XML......Page 657
How Spry handles XML data......Page 658
Making sure Spry can find data......Page 659
Creating a Spry data set......Page 660
Displaying a data set in a Spry table......Page 666
Validating pages that use Spry......Page 672
The fly in Spry’s ointment......Page 673
Displaying a data set as a list......Page 674
What’s the difference between repeat and repeatchildren?......Page 678
Planning the gallery......Page 680
Controlling the structure with CSS......Page 681
Putting everything together......Page 682
Distinguishing between data sets......Page 692
Creating a data set dynamically......Page 693
Nearly there . . .......Page 695
20 GETTING THE BEST OF BOTHWORLDS WITH PHP AND SPRY......Page 696
Generating XML dynamically......Page 697
Preparing the database table......Page 698
Using phpMyAdmin to generate XML......Page 699
Using the XML Export extension......Page 700
Updating the includes folder......Page 705
Building XML manually from a recordset......Page 706
Using a proxy script to fetch a remote feed......Page 709
Creating an XML document from a dynamic source......Page 710
Using PHP to write to a file......Page 711
How to incorporate a Spry data set in an ordinary web page......Page 714
Using XHTML with Spry......Page 719
Creating the gallery with PHP......Page 720
Generating the XML sources with PHP......Page 728
Enhancing the accessible gallery with Spry......Page 730
The end of a long journey . . .......Page 732
INDEX......Page 733