Build a basic results page – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 586

Advertising
background image

To the top

5. Select the form by selecting the <form> tag in the tag selector at the bottom of the Document window, as the following image shows:

6. In the Action box in the form’s Property inspector, enter the filename of the results page that will conduct the database search.

7. In the Method pop-up menu, select one of the following methods to determine how the form sends data to the server:

GET sends the form data by appending it to the URL as a query string. Because URLs are limited to 8192 characters, don’t use the GET
method with long forms.

POST sends the form data in the body of a message.

Default uses the browser’s default method (usually GET).

The search page is done.

Build a basic results page

When the user clicks the form’s Search button, the search parameters are sent to a results page on the server. The results page on the server,
not the search page on the browser, is responsible for retrieving records from the database. If the search page submits a single search parameter
to the server, you can build the results page without SQL queries and variables. You create a basic recordset with a filter that excludes records
that don’t meet the search parameter submitted by the search page.

Note: If you have more than one search condition, you must use the advanced Recordset dialog box to define your recordset (see Build an
advanced results page).

Create the recordset to hold the search results

1. Open your results page in the Document window.

If you don’t have a results page yet, create a blank dynamic page (File > New > Blank Page).

2. Create a recordset by opening the Bindings panel (Window > Bindings), clicking the Plus (+) button, and selecting Recordset from the

pop-up menu.

3. Make sure the simple Recordset dialog box appears.

If the advanced dialog box appears instead, switch to the simple dialog box by clicking the Simple button.

4. Enter a name for the recordset, and select a connection.

The connection should be to a database containing data you want the user to search.

5. In the Table pop-up menu, select the table to be searched in the database.

Note: In a single-parameter search, you can search for records in only a single table. To search more than one table at a time, you must
use the advanced Recordset dialog box and define a SQL query.

6. To include only some of the table’s columns in the recordset, click Selected and select the desired columns by Control-clicking (Windows) or

Command-clicking (Macintosh) them in the list.

You should include only the columns containing information you want to display on the results page.

Leave the Recordset dialog box open for now. You’ll use it next to retrieve the parameters sent by the search page and create a recordset
filter to exclude records that don’t meet the parameters.

579

Advertising
This manual is related to the following products: