The Devil is in the Details
Download the files for the Search Engine Tutorial.
Setting up the site-->
Setting up the search page-->
Setting up the results page-->
Results page continued-->
Details page and dynamic images-->
Wrapping it up-->
Create a Search Engine for the Animal Rescue
If you created an animal rescue database in phpMyAdmin according to the directions in a previous tutorial, you may find yourself wondering how you can use it in a Web based application. The next couple of articles in our series will give you some ideas.
Let’s take care of the visitor to the Animal Rescue Center Web site first. We want to find homes for as many animals as possible, so we will create a search engine by which the potential adopter can search by various cat breeds. We will need to set up a form for the search page, a results page on which to display records that match the breed given in the search, and a details page to display more information about individual cats within each breed. The results page does the lion’s (!) share of the work, but the devil is in the details. Let’s go through them carefully to see if we can get this working.
Note: This tutorial assumes that you have set up your Webserver for MySQL and PHP, and have created an animal rescue database as described in a previous tutorial. If you do not have Dreamweaver, you might want to download the 30 day free trial version at Macromedia.
Setting the Stage
After you download the companion files, use Stuffit Expander to decompress the files, and place the folder in a convenient location on your hard drive. Define a new site and name it animal_rescue. Next to the local root folder field, browse for the location of the folder you just downloaded. Skip over the remote server for now. Choose the testing server instead. You’re going to use the Apache WebServer on your Mac to test your dynamic pages. Your server model is PHP/MySQL. For Access, choose the local network. For the testing server folder, navigate to Library>Webserver>Documents. Create a new empty folder called animal_rescue. Finally, type in the URL prefix: http://localhost/animal_rescue/
Note: Alternatively, you can just place the animal_rescue folder directly in the Documents folder of the WebServer and avoid uploading the files each time you create and edit them. It is illuminating to see that you truly have a WebServer, however, and you may want to practice “putting” and “getting” files as though they were on a remote Web host.
