s4surbhi2218 Posted December 28, 2012 Share Posted December 28, 2012 Hii, please see this site http://www.fritolay.com/recipes/ i just wanted to know the logic behind the search box which has written search for a recipe and a blue btn. Please assist. many thanks Quote Link to comment https://forums.phpfreaks.com/topic/272446-how-does-a-search-box-work/ Share on other sites More sharing options...
drewdan Posted December 28, 2012 Share Posted December 28, 2012 I would imagine it queries a database looking for your search term. The content of this website is probably database driven which allows this to happen. Quote Link to comment https://forums.phpfreaks.com/topic/272446-how-does-a-search-box-work/#findComment-1401802 Share on other sites More sharing options...
cpd Posted December 28, 2012 Share Posted December 28, 2012 (edited) Depends how the search is set up. A blog search could retrieve matches on slugs and tags of posts. A website search can retrieve either titles based on slugs or scan entire page content (a little too much for me). You could cache previous searches and return the results of that search when someone else runs it. There's loads of methods that can be used to search websites. Ultimately you have a search term and content in a database; the database could be anything from MySQL to a text file. The algorithm used to gather results varies from one specification to the next. http://en.wikipedia..../Clean_URL#Slug Edited December 28, 2012 by CPD Quote Link to comment https://forums.phpfreaks.com/topic/272446-how-does-a-search-box-work/#findComment-1401805 Share on other sites More sharing options...
shlumph Posted December 28, 2012 Share Posted December 28, 2012 The search box itself is built with CSS, using image sprites. I can't really tell if this is what you're asking. But basically, the form is wrapped with a div with this background: And then the button itself has this as a background: Then depending on the state of the button/form, the background's Y offset is adjusted. Quote Link to comment https://forums.phpfreaks.com/topic/272446-how-does-a-search-box-work/#findComment-1401871 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.