Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › [PHP / ASP]Updating search bar drop down results with each character
New Posts  All Forums:Forum Nav:

[PHP / ASP]Updating search bar drop down results with each character

post #1 of 6
Thread Starter 
Hey guys,

I'm looking to create a search feature for a small PHP driven website. I wanted to know if you could implement a Google-esque 'dropdown' menu where if you type a letter, it populates the list of possible searches starting with that character.

For instance, if someone type 'a', I want the search feature to update the query for only results starting with 'a'.

I don't know if it's possible with PHP, but I am 100% certain it is with ASP. Does anyone have any examples to point me towards? Also, what is that name of such a script?
Personal PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 720 Gigabyte MA-790X-UD4P MSI GeForce 9800GT 4GB OCZ Reapers DDR2 1150 @ 800 
Hard DriveOSMonitorPower
Seagate Barracude 250gb * 2 Ubuntu 10.04 23" Dell SP2309W (2048x1152) PC Power & Cooling 610 
Case
Antec Three Hundred 
  hide details  
Reply
Personal PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 720 Gigabyte MA-790X-UD4P MSI GeForce 9800GT 4GB OCZ Reapers DDR2 1150 @ 800 
Hard DriveOSMonitorPower
Seagate Barracude 250gb * 2 Ubuntu 10.04 23" Dell SP2309W (2048x1152) PC Power & Cooling 610 
Case
Antec Three Hundred 
  hide details  
Reply
post #2 of 6
Thread Starter 
Anyone have any ideas?
Personal PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 720 Gigabyte MA-790X-UD4P MSI GeForce 9800GT 4GB OCZ Reapers DDR2 1150 @ 800 
Hard DriveOSMonitorPower
Seagate Barracude 250gb * 2 Ubuntu 10.04 23" Dell SP2309W (2048x1152) PC Power & Cooling 610 
Case
Antec Three Hundred 
  hide details  
Reply
Personal PC
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 720 Gigabyte MA-790X-UD4P MSI GeForce 9800GT 4GB OCZ Reapers DDR2 1150 @ 800 
Hard DriveOSMonitorPower
Seagate Barracude 250gb * 2 Ubuntu 10.04 23" Dell SP2309W (2048x1152) PC Power & Cooling 610 
Case
Antec Three Hundred 
  hide details  
Reply
post #3 of 6
Are you just talking about an auto-complete/auto-suggest?

I did a simple tutorial here using Asp.Net and jQuery: http://naspinski.net/post/Using-jque...th-AspNet.aspx
XPS 13
(13 items)
 
  
CPUGraphicsRAMHard Drive
Core 2 Du0 P8800 GeForce 210m 512 6GB DDR3 500GB SATA 7200 rpm 
Optical DriveOSMonitor
Slot Load DL CD/DVD Windows 7 Ultimate 13.3" HD WXGA WLED LCD 
  hide details  
Reply
XPS 13
(13 items)
 
  
CPUGraphicsRAMHard Drive
Core 2 Du0 P8800 GeForce 210m 512 6GB DDR3 500GB SATA 7200 rpm 
Optical DriveOSMonitor
Slot Load DL CD/DVD Windows 7 Ultimate 13.3" HD WXGA WLED LCD 
  hide details  
Reply
post #4 of 6
It's a AJAX script, which uses PHP, MySQL and Javascript together.
In it's simplest form, the Javascript listens for the event of someone entering a character and then passes on the text to a PHP script.
The PHP script then searches a database for similar terms through MySQL. At the same time, Javascript is constantly checking if the PHP script has finished loading.
Once the PHP script is finished, you then use Javascript to insert the results from the PHP script back into the page.
Sounds complicated, but once you get going it's relatively simple.

This should help you get started.
post #5 of 6
[Adz] it can be any combination of languages with javascript - it can also be Asp.Net, Coldfusion, perl, python, etc with MySQL, MSSQL, NoSQL, Couch, etc. as a backend. Php/MySQL is a great combination, but everything is not made with it.
XPS 13
(13 items)
 
  
CPUGraphicsRAMHard Drive
Core 2 Du0 P8800 GeForce 210m 512 6GB DDR3 500GB SATA 7200 rpm 
Optical DriveOSMonitor
Slot Load DL CD/DVD Windows 7 Ultimate 13.3" HD WXGA WLED LCD 
  hide details  
Reply
XPS 13
(13 items)
 
  
CPUGraphicsRAMHard Drive
Core 2 Du0 P8800 GeForce 210m 512 6GB DDR3 500GB SATA 7200 rpm 
Optical DriveOSMonitor
Slot Load DL CD/DVD Windows 7 Ultimate 13.3" HD WXGA WLED LCD 
  hide details  
Reply
post #6 of 6
Quote:
Originally Posted by stupid View Post
[Adz] it can be any combination of languages with javascript - it can also be Asp.Net, Coldfusion, perl, python, etc with MySQL, MSSQL, NoSQL, Couch, etc. as a backend. Php/MySQL is a great combination, but everything is not made with it.
Yeah, I know, it's just that the OP said that the site would be PHP driven, and MySQL is the most obvious choice for database access.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › [PHP / ASP]Updating search bar drop down results with each character