Search query directed through PHP for AJAX page

Post Reply
spycher
Posts: 2
Joined: Wed Dec 06, 2006 6:27 am

Search query directed through PHP for AJAX page

Post by spycher »

Hi,

I am in the process of designing an AJAX-based internal web site at my organization. Nearly all links on this site are javascript functions that contain HTTP-request calls that only update a specific portion of the web page being viewed. Server-side I use PHP and MySQL.

To enable Webinator to crawl the site all the same I have created a parallel site that mirrors all the content with real html links. Having indexed the content, I would like to add a search form to the site which sends an asynchronous javascript call to a PHP script, from where I would like to call the search engine, retrieve the results, parse these to recreate the original javascript links, and send the final output string to the javascript response handler that then will integrate the query response at the correct location in my page.

Being new to Webinator, I am not sure what is the best way to proceed after having sent the query to my php script. How do I call the search engine from PHP? Can I output the results to PHP in a more practical format for parsing? Is this all possible in principle, or am I missing something? Thanks for all recommendations and pointers!

-Sam
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Search query directed through PHP for AJAX page

Post by mark »

If you can do a web fetch from php you could contruct the proper webinator search url with query and fetch that. You may want to modify the search script (or a copy of it) to output the results in a form that would be easy to parse in php. Or a modified search script could potentially do the url transforms for you so you wouldn't need the php go-between. Just ajax fetch the custom search directly.
Post Reply