|
|
Advanced Searching with AJAX and PHP
|
05/08/2006 By Website Hosting Directory
|
AJAX has become tremendously popular to use to enhance the way your webpage is presented to your users. But AJAX can also be used in conjunction with a server side scripting language to add extra functionality to your page. In this article we will be doing exactly that - adding a site search feature to a web page using AJAX and PHP.
The first thing we need to do is plot out exactly how we want to present and execute our feature. To do this we will decide how to the user will search, and then how to display the results.
Searching and displaying
We are going to allow the user to highlight any text they want, and right click it to search the web for it. We will then take the results and display them on the right click menu for the user to see. To try something similar out, look around this site and highlight the text of any web hosting company (for example, highlight hostgator). Right click, and you will see a menu pop up showing different pages in the site that have to do with hostgator. If you highlight any other text and right click, it will give a message saying the host was not found. We are going to do something similar, but instead of searching your site, we will be using the Yahoo! api and doing a yahoo web search on the highlighted text (also check out below for some other applications this could be used for).
Read Full Tutorial ...
|
Rate this Ajax Tutorials
Rating: 7.8 out of 101 votes cast
| |
|
|
|
|
|
|
|
|
|
|
|
|