How to implement search help?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

How to implement search help?

Post by itsmani1 »

There is an option in Firefox "Remember what I enter in forms and search box".
What it does it saved the data that you enter in form and if you try write that data again it shows you this data down.

Now i want to implement some thing like this:
If you user types ch form the states list it should pick stales which starts with word "ch" like Chicago and show it in a drop down list or box.
This can be done by sending ajax request to a php page but i don't know how can i show it in search box?

any help
thank you
User avatar
louie35
Forum Contributor
Posts: 144
Joined: Fri Jan 26, 2007 8:40 am
Location: Dublin
Contact:

Post by louie35 »

That's exactly what I am working on at the moment.
What I did was to store the search queries the user made and results returned. if result were > 0 the store it else dump it.

After a while the table got enough results to start using the auto-suggest ajax.

you can check it out here: http://www.funkymotors.ie and try looking for - cd player
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It is often done with Ajax. For examples search for Google Suggest (or Suggestions)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Look for 'autocomplete'... there is a wealth of information about it on the web. Or download Scriptaculous which has a built in implementation of autocomplete.
Post Reply