ONLINEPROOFINGSITE.COM

proof of service fl - www.onlineproofingsite.com

Menu


ordering habits and possibly suggest products in the future. Furthermore, the shipping and receiving department might want to perform a


search for all orders that need to be shipped on a specific day or that need to arrive at their destinations by a certain day. This information can help you determine what kind of shipping services to add to the parcel. As you can see, just within the Dorknozzle database, there is plenty available to search on. Whether you are approaching the problem as an admin or an employee, the database ultimately is a warehouse of information. How you access that information is covered next. Creating the Dorknozzle Search Page In Chapter 23, "A Database Primer," you learned how to display dynamic data to the user. You created a query and integrated that query into your application using a server behavior that presented dynamic data. The problem with that approach is that it's hard-coded, meaning that the data the user ends up seeing always remains the same. What if your users don't want to see what you are choosing to present to them? Fortunately for you, you can allow your users to perform a search in your site based on criteria they specify through the use of form objects, recordsets/DataSets, and variables/parameters. Before we jump ahead, let's dissect a common approach to creating search functionality. Figure 27.1 shows the Amazon website and the search form you would use to search for a book. Figure 27.1. Most websites employ some way of allowing their users to search for information. [View full size image]   Suppose that you have a database with a list of book titles. The user of the website types a book name; the value of that text box is dynamically appended to a WHERE or a LIKE clause in a SQL statement. The database is then queried, and the results are presented to the user in a well-structured manner. Of course, this kind of intuitive functionality isn't limited to large companies such as Amazon and eBay. You, too, can create functionality such as this using Dreamweaver. To create your own basic SQL-based search page, regardless of server model, follow these steps: 1. Create a new page by selecting File, New. Select the Templates tab, choose the Dorknozze template called "template," and click Create. 2. Immediately save the page as search.asp, search.aspx, search.cfm, or search.php, depending on the server model you're using. 3. Select the Content Goes Here text in the Content editable region and delete it. 4. With your cursor still in the editable region, choose Insert, Form, Form. With the form selected, change the value of the Action text box in the Properties Inspector to read search_results.asp, search_results.aspx, search_results.cfm, or search_results.php, depending on the server model you're using. Make sure that the GET value is selected from the Method menu. This configuration causes the value the user enters in the text field to be passed along with the URL in the address bar (more on this later). 5. Insert a text field form object by selecting Insert, Form, Text Field. With the text field selected, enter the value txtSearch in the Name text box in the Properties Inspector. 6. Place your cursor next to the text field and insert a Submit Button form object into the form by choosing Insert, Form, Button. Change the Value text field in the Properties Inspector to read Search. The result is shown in Figure 27.2. Figure 27.2. Create a new search page by adding the necessary Text Field and Submit Button form objects. [View full size image]