Dynamic Web Pages Ch 8 V1.0

23
1 Chapter 8 Chapter 8 Dynamic searching Dynamic searching

description

 

Transcript of Dynamic Web Pages Ch 8 V1.0

Page 1: Dynamic Web Pages Ch 8 V1.0

1

Chapter 8Chapter 8Chapter 8Chapter 8

Dynamic searchingDynamic searching

Page 2: Dynamic Web Pages Ch 8 V1.0

2

Creating a search.• In this chapter you are going to

create sql statements that search for information.

• The next slides show the changes to the tours.php page, tours_details.php page and index.php page

Page 3: Dynamic Web Pages Ch 8 V1.0

3

tours.php

Page 4: Dynamic Web Pages Ch 8 V1.0

4

tours_details.php

Page 5: Dynamic Web Pages Ch 8 V1.0

5

index.php

Page 6: Dynamic Web Pages Ch 8 V1.0

6

Preparing the search page.

• Make the changes to the tours.php page as shown on the next page.

Page 7: Dynamic Web Pages Ch 8 V1.0

7

tours.php page1.Change text

2. Insert table

A recordset shown on next page.

A form with the following details

Link to tourprice.php

Recordset for the dynamic list values.

Page 8: Dynamic Web Pages Ch 8 V1.0

8

Creating the recordsets -1.

Page 9: Dynamic Web Pages Ch 8 V1.0

9

Creating the recordsets -2.

Page 10: Dynamic Web Pages Ch 8 V1.0

10

Dynamic list

Page 11: Dynamic Web Pages Ch 8 V1.0

11

Creating the repeating section

Page 12: Dynamic Web Pages Ch 8 V1.0

12

Region Link

The filtering on the link would work until we change the query on the tour_details.php page which is done later.

Page 13: Dynamic Web Pages Ch 8 V1.0

13

Now fix the index.php

A recordset and a repeat region. This is the same as the world region recordset in the tours.php page.

Profiles.php link

Contact.php link.

Page 14: Dynamic Web Pages Ch 8 V1.0

14

tours_details.php page

Link to toursprice.php shown on the next page

Recordset shown on the following slides

Insert a table

Image shown on the following pages

h2

h1

Page 15: Dynamic Web Pages Ch 8 V1.0

15

Tour price calculator link

Page 16: Dynamic Web Pages Ch 8 V1.0

16

Tour details recordset

Page 17: Dynamic Web Pages Ch 8 V1.0

17

Image details

Page 18: Dynamic Web Pages Ch 8 V1.0

18

Adding a recordset navigation

• Add a recordset navigation to the bottom of the tours_details.php page as shown.

• Add the find Tours link to tours.php page

Page 19: Dynamic Web Pages Ch 8 V1.0

19

Looking at the codeAdd this code to tours_details.php

When you select view all countries from the tours.php page this is the recordset you what to use.

When you click on the region link this is the recordset to use

If you select a country from the tours.php page then this is the recordset to use.

Page 20: Dynamic Web Pages Ch 8 V1.0

20

Adding an if in case there are no records

Add these lines

Page 21: Dynamic Web Pages Ch 8 V1.0

21

Lab 8 Overview• In this lab you will:

– Create a search interface by creating a form and allowing the user to select a value from a list/menu object and returning the tours that match the selected value.

• Objectives:– Group data in a select statement– Create a search page from a form– Implement a search results page using the

value the user selected on the form.– Add conditional logic to the SQL statement.

Page 22: Dynamic Web Pages Ch 8 V1.0

22

You will create this page

Searchreservations.php

Page 23: Dynamic Web Pages Ch 8 V1.0

23

Receiving data from searchreservations.php

bookedtours,.php