Building the Server-side Component of a Search Engine with AJAX
(Page 1 of 4 )
Are you one of those web developers wishing to find new and creative ways to use the power of AJAX? Then this set of tutorials might be what you’ve looking for! Welcome to the second installment of the series “Building a search engine with AJAX.” In three comprehensive articles, this series teaches you how to create an expansible search engine which displays results without having to reload the web page.
Introduction
Now that you know what this series is about, I'm going to review the topics that I covered in the preceding article. You'll remember that I focused all my efforts on creating an appropriate front-end for the search application such that users were able to introduce their search terms, obviously via a regular input form, and see the results returned by the server, displayed in a separate panel of the user interface.
In addition to these topics, I showed you the set of straightforward JavaScript functions responsible for sending HTTP requests in the background. These came in handy for passing different search terms to the server and displaying the corresponding results.
So far, if you've been a patient reader and tested all the client-side code of this AJAX-based application, then possibly you'll realize that the program is indeed immature. But why am I saying this? Well, to be frank, the search engine needs to be able to perform real queries against a particular database. In this way, it can deliver back to the client the pertinent results according to specific search criteria. Sounds pretty logical, right?
Okay, considering that these concepts make sense, in this second article of the series, I'll show you how to develop the core module of this search engine by using PHP 5 (other server-side scripting languages can be used, naturally). Hopefully, by the end of this tutorial, you'll have a fully-functional search engine which uses AJAX to perform the pertinent searching process in the background.
Having defined the goals for this article, let's get started.
Next: The search engine's client module >>
More JavaScript Articles
More By Alejandro Gervasio