Graphics Programs Reference
In-Depth Information
Creating Back-End Pages for Viewing Data in a Database
Pages that are intended for internal use are usually called back-end pages . For the
NextBest Fest site, the database.php and database_details.php pages are back-end pages.
You will set the database.php and database_details.php pages to display the data that
you collect in the database.
The Master Detail Page Set button in the Data category of the Insert panel enables you
to create a set of pages that presents information in two levels of detail. The master page
(in this case, the database.php page) lists all the records in the recordset that you create
for the page. The detail page (in this case, the database_details.php page) displays the
detail of the selected record. You determine which fi elds of information are displayed in
the master page and which fi elds of information are displayed in the detail page when
you set the parameters for the pages.
In addition to creating all the code needed to display the dynamic content in the
pages, Dreamweaver also adds server behaviors to create a page navigation bar so you
can move between the dynamic records if more records are in the database than are
displayed in the page. The navigation bar includes First Page, Last Page, Previous Page,
and Next Page buttons. The pages also include Display Record Count server behaviors
to indicate which records are visible in the page and the total number of records in the
database (Records x to y of z ).
To create the master page:
1. In the Server Behaviors panel, click Recordset , right-click the selected behavior,
and then click Copy on the context menu.
2. Open the database_details.php page in Design view, right-click in the Server
Behaviors panel, and then click Paste on the context menu. The Recordset behav-
ior is pasted in the database_details.php page.
3. Place the insertion point in the heading line after the heading text, press the
Right arrow key to move the insertion point past the heading text and the h1 tag,
and then press the Enter key to move the insertion point to the next line.
Trouble? If Dreamweaver locks up, you've encountered a bug that causes the
program to lock up if you place the insertion point in the line below the head-
ing and then press the Enter key when using server behaviors. End the program,
restart the computer, and then repeat Steps 1 through 3.
4. Click the Discover text in the grey bar at the top of the Document window then
click Yes in the Script warning dialog box, to enable Dreamweaver to Discover
any dynamically-related files. If another bar appears indicating that the page has
server processing directives that Design view cannot display, close it.
5. Open the database.php page in Design view, right-click in the Server Behaviors
panel, and then click Paste on the context menu to paste the Recordset behavior
into the page.
6. Place the insertion point in the heading line, press the Right arrow key to move
the insertion point past the heading text and past the h1 tag, and then press the
Enter key to move the insertion point to the next line.
7. Click the Discover text in the grey bar at the top of the Document window, then
click Yes in the Script warning dialog box, to enable Dreamweaver to Discover
any dynamically-related files. If another bar appears indicating that the page has
server processing directives that Design View cannot display, close it. Repeat this
step, as needed, whenever the grey bar appears in the Document window. In the
Data category of the Insert panel, click the Master Detail Page Set button. The
Insert Master-Detail Page Set dialog box opens. See Figure 9-13.
Search WWH ::




Custom Search