Jump to content

Auto suggestion


jatinkansagara

Recommended Posts

  • 2 months later...

You know what your asking for, but do you know how that works?

 

Then what do you plan to use?  personally im a PHP, MYSQL man.

However you got to use AJAX, XML, something like PHP and something database wise.

 

Step 1 creat the PHP/MYSQL page name it something like XML_google_like_responce.php add the headers to FORCE output as txt/xml.

 

Step 2 build your mysql_query($SELECT)' string.  $SELECT="SELECT * FROM x_table WHERE x_field LIKE x_input_value";

 

Step 2.5 mysql_fetch(){} - Do urself a favor and build an ARRAY string of the data so you can re-order the ARRAY into an ABC order so it looks professional please.  Also 2.5 remove javascript/php non-safe text from string.

 

Step 3 Output data in an XML format with the XML data safe features on, why well cause for some text XML will error out which will prevent AJAX to fetch the data right.  another issue is if you dont do the 2.5 step and remove javascript non-safe text from string your javascript might error out also preventing displaying data to the user.

 

Step 4 build the AJAX / javascript on the page with the search engine.  This takes awhile, but should be less than 15 lines of extra code which handles the data.  If you want more google like you will have to take the search key words and highlight / style them inline, thats simply BUILD style the words, you could of also done this back in step 2 or 2.5.

 

Step 4.5 this is even where i would get lost cause i dont do this stuff, you would have to creat a drop menu that auto resizes to the array of information that was fetched form the XML page along with the location of the of the drop down menu and the relative size.

 

Step 5 make sure everything is working correctly, 2ndly Browser Cross Check, if you have multi users visiting your site you will want to make sure all your users can use your google like search engine without problems.  General problems would be javascript / AJAX / CSS layout-size issues.

 

Yes making a google like search engine is possible, but personally i rather make a simple PHP search engine that skips the google like suggestion box.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.