In the Insert Table drop-down list, select the database table that you want to insert a record into.. Optional To modify the associated database column or data type of a field, select
Trang 13 To select the form, click the form’s boundaries or click the <form> tag
in the bottom-left corner of the Document window.
Selecting the form lets you modify that form’s properties in the Properties inspector
4 In the Properties inspector, enter a name for the form in the Form ID
field.
You probably want to use something descriptive, such as insert_form
Don’t set the Action or Method fields because the Insert Record server behavior sets these fields for you
5 Add a text field by choosing Insert ➪Form➪Text Field.
You can also add other form objects, depending on the type of data that you want to insert into the database table See Book II, Chapter 7 for more on the different form objects
6 In the Input Tag Accessibility Attributes dialog box, enter a
descrip-tive ID and a text label.
7 (Optional) Tweak the Style and Position settings as desired.
10 Press Enter (Windows) or Return (Mac) to insert a new line so that the
element appears on a separate line.
You can also use a table element to align your fields (see Book II, Chapter 7 for more information)
11 Insert a submit button on the page by choosing Insert ➪Form➪Button.
If the Input Tag Accessibility Attributes dialog box appears, click Cancel
12 With the button selected, change the Value text in the Properties
inspector to Insert.
The example form looks like Figure 3-4
Adding the Insert Record server behavior
You have to add the Insert Record server behavior to your page so that it can process the data in the form submission
You must have an active database connection before you can add the Insert Record server behavior See Book VII for details on setting up a database connection
Building a Record Insert Page Block by Block
Trang 2Book IX Chapter 3
To add the Insert Record server behavior, follow these steps:
1 In the Server Behaviors panel, click the plus (+) icon and select Insert
Record in the drop-down list that appears.
The Insert Record dialog box appears
2 Select your form in the Submit Values From drop-down list.
3 In the Connection drop-down list, select a database connection that
contains the table that you want to insert data into.
4 In the Insert Table drop-down list, select the database table that you
want to insert a record into.
The database columns appear in the Columns section, as shown in Figure 3-5
Depending on your dynamic page type, the Insert Record dialog box may appear slightly different For example, ColdFusion calls the Connection field a data source and includes options for Username and Password database fields However, these differences don’t change the following steps
Trang 35 (Optional) To modify the associated database column or data type of a
field, select the column from the column list and then modify the lowing fields in the dialog box:
• Value: Select the form field Each form field appears in the list.
• Submit As: Select the data type The data type that you select here
should mirror the database column data type The types are text, integer, date, and check box formats
Dreamweaver automatically links the form fields that have the same name as the database field
Figure 3-5:
Use the Insert Record dialog box
to choose which fields supply values from the form to the database table
6 For each field that you need to change, repeat Step 5.
7 In the After Inserting, Go To text field, enter the page that you want to
go to after inserting the record Or click the Browse button and select
You can make any visual changes to the form by using Dreamweaver’s tools for changing fonts, colors, and placement
Building a Record Insert Page Block by Block
Trang 4Book IX Chapter 3
Testing Your Record Insert Page
After you create a record insert page (see “Building a Record Insert Page Block by Block” section, earlier in this chapter), you probably want to test your page Follow these steps to do so:
1 Open the Record Insert page.
2 Choose File➪Preview in Browser➪Name of Browser.
3 When Dreamweaver asks if it’s okay to copy files to your testing site,
click OK.
Your browser launches and displays the Record Insert page
4 Enter some sample data into the fields.
Figure 3-6 shows some test data for the employee table
5 Click the Insert Record button.
When the data is added successfully, the browser opens the success page
Be sure that both your Record Insert page and success page transfer to the testing server If not, when you click the button on the insert page, you get a
Page Not Found error message.
The success page in our example simply contains the text Inserted
Trang 5If you want to double-check that the insert worked, follow these steps:
1 Open the Databases panel.
2 Expand the database you are working with by clicking the arrow.
3 Expand the Tables item to display the table you are working with.
4 Right-click the table on the page.
5 Choose View Data from the pop-up menu.
The View Data dialog box appears, as shown in Figure 3-7
Figure 3-7:
The View Data dialog box shows the newly inserted data
In the dialog box, you can see that the data was inserted correctly into the table
Building a Login Page
A login page enables registered users to log in to a Web site Dreamweaver CS5 comes with a sample design of a login page You can also design your own
The following sections show you how to complete the steps to building your own login page
Building a Login Page
Trang 6Book IX Chapter 3
Setting up a database table
If you set up the employee entry page, as described earlier in the chapter, you’ve already created this table
Creating the HTML form on the login page
If you want to design your own login page, first you need to create a new page and add an HTML form with a username text box, a password text box, and a submit button This process is similar to the process of adding a form
to a data entry page
Adding a Log In User server behavior to the page
After adding a form to your login page (as described in the preceding tion), the final step is to add the Log In User server behavior, which checks
sec-to make sure that the user entered a valid username and password
To add the Log In User server behavior to your login page, open the page and follow these steps:
1 In the Server Behaviors panel, click the plus (+) icon and choose User
Authentication ➪Log In User.
The Log In User dialog box appears
2 In the Get Input From Form field, select the form used on the login
page.
3 In the Username Field and Password Field text boxes, select the
appro-priate form fields.
4 If you are using ColdFusion, enter your username and password.
5 In the Table drop-down list, select the database table that you will
check the form fields against.
We selected the users table.
6 In the Username Column and Password Column drop-down lists,
spec-ify the table columns for the username and password.
For example, the users table that we selected in Step 5 contains
user-name and password columns, so we selected those columns
7 In the If Login Success, Go To text box, enter the name of the page to
open if the user logs in successfully.
Or you can click the Browse button and select the page
Trang 78 In the If Login Fails, Go To text box, enter the name of the page to
open if the user is unable to log in.
Or you can click the Browse button and select the page
9 Indicate whether you want to grant access to this page based on just the
username and password, or based on the authorization level as well.
Having multiple authentication levels provides more flexibility for segregated access to information but also comes at the cost of added complexity (and time administering your user’s levels and categorizing information) Most people can get by without setting up multiple access levels to their sites
Your login page is now complete
Restricting Access to Your Pages
If you have a Web page that you don’t want all users to be able to view, you can restrict access to it To do this, you add the Restrict Access to Page server behavior to the page so that only authorized users can view the page
If an unauthorized user attempts to open the restricted page, the user is redirected to another page
Here are a few examples of when restricted access may be useful:
Administrator privileges
page
access members-only pages
To restrict access to a page, you need to do the following tasks:
you need to add a column to your user database table to maintain mation about which access privileges each user is entitled to
infor-Restricting Access to Your Pages
Trang 8Book IX Chapter 3
Follow these steps to restrict access to a page:
1 Open the page you want to restrict access to.
2 In the Server Behaviors panel, click the plus (+) icon and choose User
Authentication ➪Restrict Access to Page.
The Restrict Access to Page dialog box appears
3 In the Restrict Based On area, select one of the following options:
✦ Username and Password: Select this option if you want only users
with a valid username and password to access the restricted page
✦ Username, Password, and Access Level: Select this option if you
want only users with specific access privileges to be able to view the page Specify one or more authorization levels for the page — for example, Administrator
4 In the If Access Denied, Go To text box, enter the name of the page to
open if an unauthorized user attempts to open the restricted page.
Dreamweaver adds a server behavior to the page ensuring that only rized users can access the page
Trang 9autho-770 Book IX: Developing Applications Rapidly
Trang 10Update and Delete Pages
In This Chapter
✓ Creating record update pages
✓ Trying out your record update page
✓ Deleting records by using delete pages
✓ Putting your delete page to the test
search, and insert data But before you go away thinking that you’ve covered everything you need to know about Web apps, we need to tell you —
dis-in the words of a late-night television dis-infomercial — but wait, there’s more!
The record update and delete operations are the last two database tions commonly used in dynamic database sites For example, suppose that employees at your company can view their employee data online Over time, they may want to change their employment details Or perhaps an H.R administrator may need the ability to delete an employee record In any case, you need to give users the ability to update and delete database records from a Web page, which is what this chapter is all about
func-Building an Update Page
Before users can update a record, they need to be able to search for the record that they want to update Therefore, you need to create a search page and a results page (See Book IX, Chapter 2 for full details on how to create and work with search and results pages.) Additionally, you need to create an update page so that users can enter the data for updating the record Here’s a closer look at the three pages that you need to create:
✦ Search page: This page allows users to search for a record that they
want to update For example, in the case of an employee record, the search page simply searches the employee that’s logged in because employees can’t modify other employee information
Trang 11✦ Update page: This page performs the update and tells the user when an
update is successful
Here’s how the update process works:
clicks the Submit button
Submit button
The first step in the update process is to create a search and results page set If you haven’t already created these pages, check out Book IX, Chapter
2 for details Then read the following sections for details on building the update page
Creating link to the update page
After you create the search and results pages, you need to create a link on the results page to open the update page and display the selected record in
an HTML form
However, before you begin, quickly create a blank dynamic page of the desired type and save it as update.php (the three-letter file extension varies based on the app server you are working with) This is a blank placeholder page that will eventually be used to update a record from the results page
After you have created a blank dynamic page, open the results page that you created based on the instructions back in Book IX, Chapter 2 and follow these steps:
1 Select the placeholder for the dynamic content for which you want to
create a link.
For example, we selected the last_name field to use as the link field, as shown in Figure 4-1 The field placeholder appears as {employee_search
last_name}
2 In the Properties inspector, click the Browse for Folder icon to the
right of the Link field.
3 In the Select File dialog box, select the update page that you just
cre-ated.
For example, we selected update.php as the update page For other language types, use the appropriate file extension (such as asp) rather than php
Building an Update Page
Trang 12Book IX Chapter 4
4 Click the Parameters button.
The Parameters dialog box appears
5 Enter the key field from your database record in the Name column.
The key field is a field that always has a unique value For example,
we entered empid because this field contains a unique ID for each employee
6 Click the Value column to the right of Name.
The Value edit box is highlighted
7 Click the Bind to Dynamic Source (lightning bolt) icon to the right of
the highlighted box.
The Dynamic Data dialog box appears, as shown in Figure 4-2
8 Select the key field from the recordset, and then click OK.
After you click OK, the Values field in the Parameters dialog box is updated to contain the URL parameter
9 Click OK to close the Parameters dialog box.
The Select File dialog box appears with an updated value in the URL field The value in this field varies depending on your dynamic page
Trang 13Figure 4-2:
The Dynamic Data dialog box
Figure 4-3:
The updated URL field in the Select File dialog box
10 Click Choose to close the Select File dialog box.
The Document window shows the new link
11 Save the results page.
The results page is now complete
Putting the update page together
The update page must read the URL parameter from the results page and store it in a recordset The recordset provides the default values for the form that enables users to change values The following sections show how
to create the recordset and the form
Building an Update Page
Trang 14Book IX Chapter 4
Creating the recordset to store the URL parameter
To create the recordset, follow these steps:
1 Open the results page you created in the preceding section.
You must have an active database connection to create the recordset
See Book VII for details on creating a database connection
2 In the Bindings panel, click the plus (+) icon and then select Recordset
(Query) from the menu that appears.
The Recordset dialog box appears
3 Enter the name of the recordset in the Name field.
Use a name that describes the recordset data For example, we entered employee_update to indicate that the recordset relates to an update
4 Select a database connection in the Connection drop-down list.
Depending on your dynamic page type, the Recordset dialog box may appear slightly different For example, ColdFusion calls the Connection field
a data source and includes optional Username and Password fields for the database However, these differences don’t change the following steps
5 In the Table drop-down list, select the database table that you want to
update.
After you select a table, the Columns list displays the columns in that table
6 (Optional) If you want to include only some of the columns from the
table for updating, click the Selected option.
7 In the Columns list, select the columns that you want to update.
To select multiple columns, Ctrl+click (Windows) or Ô+click (Mac)
8 Configure the Filter area so that the database column is compared
against the URL parameter from the results page:
• In the first list, select the key column For example, we selected empid, which is the key column for the employee table
• In the second list, select the equals sign (=) This selection limits the result set to only the record that you want to update You can update only one record at a time
• In the third list, select URL Parameter
• In the fourth list, enter the name of the URL parameter defined in the results page For example, we entered empid, the same name as the database key column name
Trang 15The new recordset retrieves the information needed to update the records that the user has selected to update When the update page is requested, it uses the record ID parameter sent to the page to filter the recordset The Recordset dialog box for the example looks like Figure 4-4
The recordset is added to the Bindings panel list Now when the user selects a record on the results page, the update page builds a recordset containing only the selected record
Figure 4-4:
The Recordset dialog box configured
to select only the record to update based
on the specified URL parameter
Adding a form to the update page
After creating the recordset for the update page (which you can read about
in the preceding section), you need to create the form that enables the user
to modify the record data Dreamweaver can do the work for you with the Record Update Form Wizard This wizard automatically creates the form in the Document window and adds the appropriate server behaviors to allow updates
If you’ve used the Insert Record Form Wizard, you’ll find this wizard similar
Follow these steps to add an HTML form to your update page:
1 Choose Insert ➪Data Objects➪Update Record➪Record Update Form
Wizard.
The Update Record Form dialog box appears
Only one application object can exist on the same page You can’t have
an update application object and a delete application object on the same page
Building an Update Page
Trang 16Book IX Chapter 4
2 Select the database connection in the Connection drop-down list.
3 Select the database table that you want to update in the Table to
Update drop-down list.
4 From the Select Record From drop-down list, select the recordset that
you created, as described in the preceding section.
This list should default to the recordset that you created in the ing section
5 In the Unique Key Column drop-down list, select a key column to
iden-tify the record in the database table.
For example, we selected empid Leave the Numeric check box selected
if the key fields are numeric
6 In the After Updating, Go To text box, enter the page that you want
to open after the record is updated Alternatively, click the Browse button to select a file.
For example, we selected a page called success.php, which simply plays a success message You can create the page before or after enter-ing the filename for it
7 To remove unwanted columns from the update page, select the
col-umns in the Form Fields section and click the minus (–) icon.
By default, Dreamweaver includes all the columns of the table in the form on the update page The Form Fields section lists the columns in which the user can enter data before submitting the update request For our example, we removed the empid file because it’s an autogenerated key field Removing this field eliminates the risk of the user changing the key value to a duplicate value
8 (Optional) If you want to make changes to how a field appears on
the update page, select the field from the list and fill in the following fields in the dialog box:
• Label: Enter a descriptive label This label appears on the form next
to the field By default, Dreamweaver uses the column name as the label So, for example, rather than use the default label of first_name, you could change it to First Name
• Display As: Select a form type The Display As list includes all the
basic form types, including check boxes, radio buttons, and menus If you select one of the types that needs additional configuration, such
as radio groups, a configuration dialog box appears
• Submit As: Select the data format The data format is the type of
data that the database column is expecting The default matches the
Trang 17• Default Value: Specify a default value The value that you enter in
the Default Value field is the initial value that appears in the form for the particular field If you don’t enter a value here, Dreamweaver uses the current value from the database for the initial value
You can change the dynamic data source for the default value by clicking the Bind to Dynamic Source (lightning bolt) icon and select-ing a binding The value defaults to the value from the recordset If the data type is a menu, radio group, or check box, another dialog box appears to configure the choices available to the user For example, a check box has a setting to determine whether it should be automatically checked when the update page appears
9 (Optional) Repeat Step 8 for each field that you want to modify in the
Form Field list.
The dialog box for the example looks like Figure 4-5
Figure 4-5:
The Record Update Form dialog box after configuring
an update
10 (Optional) If you want to change the order in which the fields appear
in the form, select a field and click the up arrow or down arrow.
Table fields should be grouped with similar fields (for example, address fields should all be placed together)
11 Click OK to close the Record Update Form dialog box.
The new form appears as a basic table on your update page Figure 4-6 shows the form created for the example You can modify the appear-ance of form objects as you can any other object in Dreamweaver, but remember to not move them outside the form’s boundaries (See Book
II, Chapter 7 for more on form objects.)
Building an Update Page
Trang 18Book IX Chapter 4
Testing Your Update Page
You can test your results page by previewing it in a browser Before doing
so, make sure the latest versions of your search, results, and update pages are on your server Then follow these steps:
1 Open the search page in Dreamweaver.
2 Choose File➪Preview in Browser➪Name of Browser.
3 Enter search criteria in the box and click the Search button.
The results page is displayed with the matching records (see Figure 4-7)
4 Select a record to update by clicking the link for that record.
In our example, the last name for each employee is linked to the update page The browser displays the update page for that record We clicked the Jason Bourne link on the results page, and the browser displayed the update page with the record for Jason, as shown in Figure 4-8
Be sure that both your search results page and update page transfer to
the testing server If both don’t transfer, you get a Page Not Found error
message when you click a link in the update results page
5 Enter a new value for one or more of the fields on the update page.
Trang 19Figure 4-7:
The browser displays the rows that can be updated
Figure 4-8:
The update page is displayed
Your changes are saved to the database, and the success page appears
in the browser (see Figure 4-10)
What’s more, to verify the update was saved, you can navigate back to the update results page to verify the new value
Testing Your Update Page
Trang 20Book IX Chapter 4
Building Pages to Delete a Record
The typical process for deleting records from a database consists of a few steps First, users select which record to delete After they select a record, a confirmation page appears, asking them to confirm the delete request to pre-vent deleting a record accidentally Finally, a page appears indicating that the record was successfully deleted from the database
Trang 21For users to be able to delete a record, they first need to be able to find that record in the database Therefore, you need to create a search page and a results page so that users can search for the record See Book IX, Chapter 2 for details
The following sections detail how to build the pages that allow a user to delete a record from the database
Creating delete links to open the confirmation page
After you create a search page and results page, you need to create a Delete
link for each record in the results table that users can click to open a
confir-mation page, which is a page that asks them to confirm the deletion.
However, before you begin, quickly create a blank dynamic page of the desired type and save it as confirm.php (the extension varies based on the app server you are working with) You’ll add content to this file in a moment, but for now, you just need to link to it
To create the links to the confirmation page, open the results page and follow these steps:
1 Select the last column in the results repeated region.
2 Choose Insert ➪Table Objects➪Table➪Insert Column to the Right.
An empty column appears at the end of the table The empty column is skinny
3 Select the new column’s lower cell, which is part of the repeated
region.
5 Select the text you just entered to apply a link to the text.
6 In the Properties inspector, enter the name of the confirmation page
in the Link field.
Defining the URL parameter to pass to the confirmation page
After you create a delete link that displays the confirmation page (see the preceding section), you want to modify that link so that it passes the identity
of the record that the user wants to delete To define the URL parameter that identifies which record to delete, follow these steps:
Building Pages to Delete a Record
Trang 22Book IX Chapter 4
1 Follow Steps 1–6 in the “Creating delete links to open the
confirma-tion page” secconfirma-tion, earlier in this chapter.
The deletion process follows a parallel pattern to the record update
2 Click the plus (+) icon to add another parameter.
An empty row appears in the list
3 Enter the name of a column that describes which record is about to be
deleted on the confirmation page.
For the employee table example, we are using the last name field In a real-world situation, you would probably want to add more fields to confirm the deletion But for this purpose, the last name field works fine
Figure 4-11 shows the two parameters for the employee table
4 Click OK to close the Parameters dialog box.
The Select File dialog box appears with an updated value in the URL field The value in this field varies depending on your dynamic page type
5 Click OK to close the Select File dialog box.
The Document window shows the new link
6 Save the results page.
The results page is complete The delete link now appears on the page,
as shown in Figure 4-12
Trang 23Figure 4-12:
The Document window with the new Delete link
Building the confirmation page
The Confirmation page simply displays enough information to identify the record that’s about to be deleted This page consists of a form with a confir-mation button
To create a page that confirms the record deletion, you need to send two parameters to the confirmation page:
This page saves you from having to create another recordset with a filter to look up information that’s already been retrieved from the database
Follow these steps to create the confirmation page:
1 Open up your confirmation page.
We opened up confirm.php
2 In the Bindings panel, click the plus (+) icon and select URL Parameter
from the list that appears.
The URL Variables dialog box appears
Building Pages to Delete a Record
Trang 24Book IX Chapter 4
For the example, we entered empid because we need to create a binding
for the URL parameter empid
The binding is created
5 Repeat Steps 3 and 4 for the last name parameter.
For the example, we also created a last_name parameter
6 Choose Insert ➪Form➪Form to add a form.
7 Choose Insert ➪Form➪Hidden Field to add a hidden field to store the
record ID.
The user doesn’t need to see the empid parameter, but that ID needs to
be part of the form submission
8 With the hidden field selected, enter the name of the variable in the
Hidden Field text box in the Properties inspector.
For example, we entered empid_field
9 Click the Bind to Dynamic Source (lightning bolt) icon next to the
Value field.
The Dynamic Data dialog box appears
10 Select the type of binding (URL Parameter, for example) in the
bind-ings list.
For the example, we selected the empid URL parameter You can leave the other fields set to their defaults
11 Click OK to close the Dynamic Data dialog box.
In the Properties inspector, Dreamweaver updates the Value field with dynamic code to place the URL parameter in the hidden form field
12 Click in the hidden field in the form and type Do you wish to delete
the record for ? This text tells users they’re about to delete a record
13 Position your cursor just before the question mark, click the plus (+)
icon in the Server Behaviors panel, and select Dynamic Text from the menu that appears.
The Dynamic Text dialog box appears, as shown in Figure 4-13
Trang 25Figure 4-13:
The Dynamic Text dialog box
14 Select the empid URL Parameter in the list, and then click OK.
If you’re using a different column as the key, select that parameter instead
15 Choose Insert ➪Form➪Button to add a submit button to your form.
The Input Tag Accessibility Attributes dialog box appears
16 Type delete_btn in the ID field.
17 Click OK to close the dialog box.
18 Select the button element on your page.
19 In the Properties inspector, enter Delete in the Value field.
The button’s text changes to Delete, as shown in Figure 4-14
Use the name that you selected when creating the Delete link (see
“Creating delete links to open the confirmation page,” earlier in this chapter)
But wait, there’s more! The page isn’t complete yet because it can’t
process the deletion You need to add logic to delete the record, as described in the following section
Building Pages to Delete a Record
Trang 26Book IX Chapter 4
Adding logic to delete the record
Dreamweaver adds the logic to perform the database deletion with the Delete Record server behavior To add this behavior to the HTML form, follow these steps:
1 In the Server Behaviors panel, click the plus (+) icon and select Delete
Record from the menu that appears.
The Delete Record dialog box appears
2 Select Primary Key Value in the First Check If Variable Is Defined
Trang 276 Select Form Variable in the Primary Key Value drop-down list.
Form Variable is the hidden field value from the form submission
7 In the text field next to the Primary Key Value drop-down list, enter
the name of the field that contains the key value.
Again, we entered empid_field for the example
8 In the After Deleting, Go To text box, enter the page that you want to
open after deleting the record.
We entered success.php for the example You can make this page as
simple as the statement Deleted Successfully The Delete Record dialog
box for the example looks like Figure 4-15
Figure 4-15:
The Delete Record dialog box set to delete
an entry
9 Click OK to close the dialog box.
Dreamweaver adds the new server behavior to the page
The deletion pages are complete
Testing Your Delete Page
To test your delete page, follow these steps:
1 Open the search page that you created in Dreamweaver.
2 Choose File➪Preview in Browser➪Name of Browser.
Testing Your Delete Page
Trang 28Book IX Chapter 4
get a Page Not Found error message when you click a link in the delete
results page If they don’t transfer, copy or upload them to the server before continuing
4 Enter search criteria in the text box, and then click the Search button
to display records.
The modified results page is displayed, which now allows the user to select a record that she wants to delete Your browser opens and dis-plays a list of records that you can delete For example, Figure 4-16 lists the employee records that we can delete
Figure 4-16:
The browser
displays
records
5 Click the Delete link next to the row that you want to delete.
The browser page displays the delete confirmation page Figure 4-17 shows the delete confirmation page for the example
Trang 29790 Testing Your Delete Page
6 Click the Delete button.
The browser displays the success page if the operation is successful
To verify the record deletion, you can navigate back to the delete results page to make sure the record doesn’t appear on that page anymore
Figure 4-17:
The deletion confirmation page shows the employee last name of Bond
Trang 30Special Characters and Numerics
expression error message, 66780040e10: Too few parameters error
message, 66780040e14: Syntax error in INSERT INTO
statement error message, 66880040e21: ODBC error in Insert or Update
error message, 668800a0bcd: Either BOF or EOF is true error
Accept Anything validation setting, 195
Accept Email Address validation
setting, 195Accept Number From/To validation
setting, 195Accept Number validation setting, 195
creating database connection with Data Source Name, 627–629
creating new page, 626–627custom connection string, 626Data Source Name, 625–626database connections, 625–626deleting database connection, 633editing database connection, 633MapPath() method, 631–632overview, 610, 625
physical path, 631–632virtual path, 632
ActiveX controls See also Java applet
aligning, 142alternate image, 142base, 142
class, 142classID, 142data, 142defi ned, 140embedding, 142
ID, 142name, 142overview, 138parameters, 142playing/stopping, 142properties, setting, 140–142whitespace, 142
width and height, 142Add Object to Library, 284Administer Website dialog box, 570–571, 573
Administrator Password dialog box, 573Adobe After Effects, 132
Adobe AIR, 349–350Adobe AIR extension for Dreamweaver, 349–350
Adobe AIR Marketplace, 350Adobe Bridge
accessing, 346inserting fi le from, 347
Trang 31Dreamweaver CS5 All-in-One For Dummies 792
Adobe BrowserLab, 144, 480–481
Adobe Community Help, 352–353
Adobe Community Help dialog box, 30
Adobe Connect Now, 351–352
Adobe Contribute, 55
Adobe Exchange, 724
Adobe Online Forums, 33
Adobe Product Improvement Program, 33
anchor points See also invisible elements
for aligned elements, 70for AP elements, 70animated GIFs, 310
anti-aliasing, 131
AP Div layer
aligning, 372converting tables to, 381converting to table, 378–380default names, 368
drawing, 363–364dropping, 363inserting, 363managing with AP Elements panel, 367–370
moving, 372multiple, selecting, 371naming, 369
preferences, setting, 366–367preventing layer overlap, 368–369resizing, 372
selecting, 371stacking order, 369visibility, 420–422z-index numbers, 367–369
App Developer layout, 11App Developer Plus layout, 12Appear/Fade (Spry Effect), 401Apple Final Cut Pro, 132Apple QuickTime Pro, 132applets
aligning, 140alternative content, 140base, 140
class, 140code, 140name, 140overview, 138parameters, 140properties, setting, 139–140whitespace, 140
Application barMacintosh location of, 14overview, 15
Windows location of, 13application layer, 604
application server See also Web server
Active Server Pages, 610Apache, 606
ASP.NET, 610ColdFusion, 611hosted sites, 605Java Server Pages, 610Microsoft IIS, 607–608PHP, 608–610
Web/application server combinations, 611–612
ASP (Active Server Pages) See also
database connectionsconnecting to remote database without DSN, 631–633
creating database connection with custom connection string, 629–630creating database connection with Data Source Name, 627–629
creating new page, 626–627custom connection string, 626
792
Trang 32Data Source Name, 625–626database connections, 625–626deleting database connection, 633editing database connection, 633MapPath() method, 631–632overview, 610, 625
physical path, 631–632virtual path, 632
ASP.NET See also database connections
creating links that open detail page, 742–745
creating new page, 636–637deleting database connection, 641detail page, 744
editing database connection, 639–640master page, 742
OLE DB connectiondata link properties, 639settings, 638
templates, 637–639overview, 610, 635SQL Server connection, 636, 639–640system requirements, 755
Assets panel
inserting images with, 98–99renaming templates in, 279–280Attach External Style Sheet dialog
box, 220attributes, searching for, 89–91
audience, and web site design, 37
audio fi les
AIFF, 146embedding, 147–148
fi le formats, 145–146linking to, 147MIDI, 145MP3, 145QuickTime, 145Avid Xpress DV, 132
B
<b> tag, 80
background fi le activity log, 543
background propertiesattachment, 231color, 230
fi xed, 231image, 231inherit, 231position, 231repeat, 231scroll, 231base URLs, 611–612BEA WebLogic, 610Beach, Matt, 44behaviorsactions, 385attaching, 390–391Call JavaScript, 393–394Change Property, 394–395changing, 391–392Check Plugin, 395–397controlling layers with, 378default, 389
deleting, 391–392deprecated, 384Drag AP Element, 378, 397–400Dreamweaver extensions, 425–428editing, 391–392
events, 385
Go to URL, 403–405Jump Menu, 405–408Jump Menu Go, 405–408Open Browser Window, 408–411Popup Message behavior, 411–413Preload Images, 413–414
servercreating, 724–727defi ned, 723Insert Record, 762–764Log In User, 767–768Restrict Access to Page, 768–769web site, 724
Set Text of Container, 378, 414–415Set Text of Frame, 416–417
Set Text of Status Bar, 417–418Set Text of Text Field, 418–419
Trang 33Dreamweaver CS5 All-in-One For Dummies 794
behaviors (continued)
Swap Image, 422–424Swap Image Restore, 424–425third-party, 425–428
updating, 392–393using, 282
Validate Form, 425Behaviors panel, 389–390
Bind to Dynamic Source (lightning bolt)
icon, 773Bindings panel, 676
_blank option (frames), 455
Blind (Spry Effect), 401
block snippets, 300, 301
blocks
compact, 234displaying, 233inherit, 234inline, 233letter spacing, 233listing items, 233marker, 234overview, 232table, 234text align, 233text indent, 233vertical align, 233whitespace, 233word spacing, 233
<body> tag, 76
border
color, 235–236properties, setting, 235–236style, 236
width, 235–236box properties
clear, 235
fl oat, 235margin, 235overview, 234padding, 235width/height, 235
<br> tag, 76
BrandGopher, 350
Bridgeaccessing, 346inserting fi le from, 347launching Dreamweaver from, 347launching from Dreamweaver, 347using, 346
web site, 346Brightness and Contrast tool, 106broken links, 492
Browser Compatibility reportediting Ignored Issues List, 490error, 489
ignoring specifi c errors, 490jumping to code in, 490jumping to next or previous error in, 490message, 490
overview, 483, 487performing other tasks, 490running, 489–491
saving, 490setting target browsers for, 487–488viewing and fi xing errors, 491viewing long error messages in, 490viewing report in browser, 490warning, 489
Browser Navigation toolbarLive View mode, 21Normal Mode, 20overview, 20browser optimization, 42BrowserLab, 144, 480–481browsers
compatibility testing, 487–488optimizing, 42–43
previewing pagesdynamic pages, 705–707
bulleted list, 87
Trang 34Business Catalyst InContext Editing
Help, 32buttons, creating, 188–190
C
Call JavaScript behavior, 393–394
Cascading Style Sheets (CSS)
adding properties to style, 224–225adding style to style sheet, 217–220All mode panel, 209
applying class style, 221–222attaching, 210
benefi ts of, 202categories, 211class styles, 212–213Code Navigator, 227, 246–247compound styles, 215–216controlling layer style and positioning with, 375–378
converting internal styles to CSS rules, 243–244
CSS Inspect, 247–248CSS Rule Defi nition dialog box, 228–240
Current model panel, 209declaration, 211
deleting CSS property, 210deleting style, 225
design time style sheets, 245disabling/enabling CSS property, 210editing
in All mode, 223–224
in Current mode, 224icon, 210
enabling/disabling properties, 225–227exporting internal style to external style sheet, 242–243
external, 204
ID styles, 213–214inline styles, 207–208internal styles, 204–206layout, 64
new rule, 210
panel, 208–211Properties Inspectoralign center, 84align left, 84align right, 84bold, 83cascade, 82class style, applying, 82class style, removing, 82CSS panel, 82
edit rule, 82font, 83inline style, 82italic, 83justify, 84page properties, 84size, 84
targeted rule, 82text color, 84renaming styles, 240–242rule defi nition
background properties, 230–232block properties, 232–234border properties, 235–236box properties, 234–235extensions properties, 239–240list properties, 236–237positioning properties, 237–239type properties, 228–230rules, 211
selector, 211, 217–218tag redefi ne styles, 215types, 204–206
case-sensitive links checking, 53Catalyst Group Design, 42cells
background color, 164formatting, 163–164header, 164
height, 164horizontal and vertical alignments, 164inserting text and images, 163
merging, 160padding, 153, 158
Trang 35Dreamweaver CS5 All-in-One For Dummies 796
cells (continued)
spacing, 154, 158splitting, 160width, 164centimeters, 84
Certifi ed Service Providers, 521
CFCs (ColdFusion Components)
access, 722benefi ts of, 717component directory, 721conditional code block execution, 723creating, 720–722
display name, 720extends, 721hint, 720–721including in Web pages, 718–720name, 721
return type, 722using, 717–718Change Link Sitewide dialog box, 123,
517–518Change Property behavior, 394–395
check boxes See also forms
adding, 711–712inserting, 179–180inserting group of, 180–181overview, 179
Check Browser Compatibility, 19
Check In/Check Out system,
537, 557–559Check Plugin behavior, 395–397
Check Spelling dialog box, 507
Checkbox Group dialog box, 180–181
Circle Hotspot tool, 109–110
class style, applying, 221–222
uncloaking previously cloaked fi les, 534closed eye (layer visibility), 370
CLR (Common Language Runtime), 610CNET, 521
codeapplying source formatting to fi le, 514–515
applying source formatting to selection in
fi le, 515–517cleaning up Word HTML, 504–506color, 511
consistency in HTML/XHTML, 508–510Copy/Paste preferences, 502–504format
advanced formatting, 513case rules for tags and attributes, 512default attribute case, 512
default tag case, 512indent, 511
line break type, 512tab size, 511
TD tag, 512formatting issues, 502hints
close tags, 513description tool tips, 513menus, 513
JavaScript Extractor, 515–517overview, 501–502
Paste Special command, 504preferences, setting, 510rewriting, 513–514spelling, grammar, and readability, 506–508
Code Navigator, 75, 227, 246–247code snippets
creatingwith graphics, 309–310with Wrap Selection option, 306–308deleting, 312
Trang 36editing, 312JavaScript snippet, 304–306managing, 312
overview, 301sharing, 311text snippets, 302–303Code view
adding text in, 75editing text in, 76–77Macintosh location of, 14Windows location of, 13Coder layout, 12
Coder Plus layout, 12
Coding toolbar
Macintosh location of, 14overview, 15–16
Windows location of, 13
ColdFusion See also database connections
adding database connection, 652application
debugging, 498–499Web/application server combinations, 611confi guring database connectionwith Coldfusion Administrator, 654–656
in Dreamweaver, 656–657creating new document, 653database connection information, 651deleting database connection, 659Developer Center, 652
editing database connectionusing ColdFusion Administrator, 658–659
using Dreamweaver, 657–658Help, 32
overview, 651–652specifying RDS login information, 653–654ColdFusion Administrator, 654–656
ColdFusion Components (CFCs)
accessing, 722benefi ts of, 717component directory, 721conditional code block execution, 723creating, 720–722
hint, 720–721including in Web pages, 718–720name, 721
return type, 722using, 717–718ColdFusion Markup Language (CFML), 471
colon (:), 211colorshexadecimal numbers, 83palette, 331
Web-safe, 83columnsadding, 162deleting, 163merging, 158–159multiple, adding, 162–163splitting, 158–159
in tables, number of, 153commands
deleting, 317playing, 315–317recording, 314renaming, 317Commands menu, 316comments, 70
Common Language Runtime (CLR), 610comp, 44
Components panel, 718–719compound styles, 215–216concepts, in web site design, 38–41conditional code block execution, 723Confi gure RDS Server dialog box, 530–531confi rmation page, 782
ConnectNow, 351–352containers, text of, 414–415content, 43
Contribute Administrator, 569Contribute compatibility, 54–55, 568–569Contribute fi les
administrative fi les, 576–577deleting, 586
editing, 585moving, 585
Trang 37Dreamweaver CS5 All-in-One For Dummies 798
Contribute site
administering, 569–571administering sites, 569–571best practices, 566–567checking _mm folder, 578–579connecting to, 574–575connecting to sites, 567–569connection keys, 569creating templates, 572–573editing style sheets in, 588–589enabling users to use templates, 586–587
fi xing connection problems, 577–578management tasks, 582–583
managing with Dreamweaver, 581–589organization tips, 574
overview, 565–566, 581–582restrictions, 575
rolling back fi les in Dreamweaver, 583–585setting fi le and folder permissions, 576site-organization tips, 574
templates, 572–573transferring fi les from within Dreamweaver, 575–576unlocking checked out fi le, 587updating templates in, 588Convert Inline CSS dialog box, 244
Convert Tables to AP Divs dialog box, 381
copyright, 40, 283, 300
core JavaScript (CJS), 385
cost of web site design, 38
Create a New Code Block dialog box, 725
Create Components dialog box, 720
Creative Suites Extended Services (CSXS)
Access CS Live panel, 354Help tool, 352
local help, 353managing, 354–355offl ine help, 352
online help, 352overview, 350Share My Screen (ConnectNow), 351–352third-party Flash-based services, 354Crop tool, 106
cross-application integrationAdobe AIR, 349–350
Adobe Bridge, 346–347Adobe Flash, 338–339Creative Suites Extended Services, 350–355
Device Central, 347–349overview, 337
PhotoshopCopy/Paste workfl ow, 344–346overview, 339
Smart Objects workfl ow, 340–344CSS (Cascading Style Sheet)
adding properties to style, 224–225adding style to style sheet, 217–220All mode panel, 209
applying class style, 221–222attaching, 210
benefi ts of, 202categories, 211class styles, 212–213Code Navigator, 227, 246–247compound styles, 215–216controlling layer style and positioning with, 375–378
converting internal styles to CSS rules, 243–244
CSS Inspect, 247–248CSS Rule Defi nition dialog box, 228–240Current model panel, 209
declaration, 211deleting CSS property, 210deleting style, 225
design time style sheets, 245disabling/enabling CSS property, 210editing
All mode, 223–224Current mode, 224icon, 210
enabling/disabling properties, 225–227
Trang 38exporting internal style to external style sheet, 242–243
external, 204
ID styles, 213–214inline styles, 207–208internal styles, 204–206layout, 64
new rule, 210overview, 201–203panel, 208–211renaming styles, 240–242rules, 211
selector, 211, 217–218tag redefi ne styles, 215types, 204–206
edit rule, 82font, 83inline style, 82italic, 83justify, 84page properties, 84size, 84
targeted rule, 82text color, 84CSS Rule Defi nition dialog box
background properties, 230–232block properties, 232–234border properties, 235–236box properties, 234–235extensions properties, 239–240list properties, 236–237opening, 223
CSXS (Creative Suites Extended Services)Access CS Live panel, 354
Help tool, 352local help, 353managing, 354–355offl ine help, 352online help, 352overview, 350Share My Screen (ConnectNow), 351–352third-party Flash-based services, 354curly brackets {}, 706
custom connection string, 626, 629–630Custom JDBC Connection, 644
cut and paste cursor trail, 387–388
D
datamany-to-many, 615normalization rules, 615one-to-many, 615one-to-one, 615relationships, 615data fi eld, 743Data Grid dialog box, 742data source
defi ned, 673form parameters, 675–677overview, 673
recordset, 681–684session variables, 679–681sources of, 673
URL, 677–679Data Source Name (DSN), 625–629
“Data source name not found” error, 667
“Data type mismatch in criteria expression” error, 667database connectionsActive Server Pagesconnecting to remote database without DSN, 631–633
creating database connection with custom connection string, 629–630creating database connection with Data
Trang 39Dreamweaver CS5 All-in-One For Dummies 800
database connections (continued)
creating new page, 626–627custom connection string, 626Data Source Name, 625–626database connections, 625–626deleting database connection, 633editing database connection, 633MapPath() method, 631–632overview, 610, 625
physical path, 631–632virtual path, 632ASP.NET, 635–641creating links that open detail page, 742–745
creating new page, 636–637deleting database connection, 641detail page, 744
editing database connection, 639–640master page, 742
OLE DB connection, 637–639overview, 610, 635
SQL Server connection, 636, 639–640system requirements, 755
ColdFusionadding database connection, 652confi guring in Dreamweaver, 656–657confi guring with Coldfusion
Administration, 654–656creating new document, 653database connection information, 651deleting database connection, 659editing with Coldfusion Administration, 658–659
editing with Dreamweaver, 657–658overview, 651–652
specifying RDS login information, 653–654
errors, 661JavaServer Pagesadding database connection, 644–645connecting to database, 647–648creating new document, 646–647database connection information, 643–644
database connection types, 644–645deleting database connection, 648–649
editing database connection, 648–649installing JDBC driver, 645–646Java Runtime Environment, 645overview, 643
troubleshooting database connections, 668
MySQLcreating database connection for PHP, 619–621
creating new dynamic PHP page, 617–618
deleting PHP database connection, 622–623
driver, 645editing PHP database connection, 622overview, 615
validating username and password, 663PHP, 617–623
Database Development For Dummies
(Taylor), 615databaseschoosing, 615–616defi ned, 614exploring in Databases panel, 674–675
fi led-based, 664–666IIS, 664–666
Microsoft Offi ce Access, 616Microsoft SQL Server, 616MySQL, 615
object typesstored procedures, 674–675tables, 674–675
views, 674–675PostgreSQL, 616recordset, 681–684, 690–697troubleshooting
fi le permissions, 664–666general, 669
identifying problems in database, 668–669
JSP database connections, 668Microsoft error messages, 666–668validating username and password, 663–664
verifying contact with server, 661–662Databases panel, 674–676