Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

website search

Dear Experts,

I want to add a search field on my website. The website was built with Dreamweaver CS4 and CSS.

I do not want a search field like Google or Yahoo.

I want a search field like the one used on Wikipedia. An user types any word and it displays a list of words. Upon selecting the exact word, the user is then directed to the specified URL.

If the search field can use JQuery, it's good. There's one exemple here: JQuery exemple

I want to use the search field with JQuery. However, I don't have any idea if I have to add all words (1000 words) in the "var names" function. Also I don't know how to link a specific word to its own url.

The website contains one video per page. If a video is named "Ethan", search field shows "Ethan", user selects it and the page is then displayed.

How I can do that ?

Many thanks in advance
0
currentdb
Asked:
currentdb
  • 5
  • 3
3 Solutions
 
johanntagleCommented:
Such a functionality actually uses AJAX that searches the database for candidate words based on the typed word.  You don't store the words in the function.  You can find demos and sample code at http://www.javascript-examples.com/autocomplete-demo/
0
 
currentdbAuthor Commented:
Hi johanntagle,

Thank you for the link to this website. Some scripts worked in 07,08,09 (3 examples). However, I still do not understand how any input word will then show the web page related to this word.

If the words are not stored in the function, then where they have to be stored? Can they be stored on the server? If yes, how ?

Thanks again for your patience.
0
 
johanntagleCommented:
They are stored in the database.  AJAX code then does the search.  Take a look at the code of example 08 in the page I gave you - the ajax-list-countries.php contains the query that does the search.  Maybe you can make it in such a way that the title and the url of the matching pages are retrieved, then when you the user does a selection, you submit the url to another page whose only functionality a redirect to the url it received.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
currentdbAuthor Commented:
I am still lost down here. How I can submit the url to another page that will redirect the received url? It looks quite complex :(
0
 
johanntagleCommented:
No it should be simple, whatever language you use.  You submit the url just like you submit any value from a form.  It's just a value.   The page that receives it just needs to  generate a <meta http-equiv="Refresh" content=0;URL=http://submitted_url" />, which causes the browser to redirect to the submitted url.

Exactly how it's done in Dreamweaver, I don't know as I don't use that.  (I found your question in the MySQL zone, sorry).
0
 
currentdbAuthor Commented:
Let's forget Dreamweaver for now. It will probably be of no use at all.

So the first step is to create a database (MySQL database). I am not sure if I am correct on this.

Second, populate this database with 800 records.

Third step, redirect to the right web page. If this cannot be done in Dreamweaver, how I can do this and with what software ?

Thanks again for your patience.
0
 
johanntagleCommented:
Any web application development tool or language, Dreamweaver included, will allow you to do that.  Pick one, study it well, and you will realize it's quite simple.  Sorry if this sounds like a j*ck*ss answer, but based on this and your previous questions it seems you are very new to web development, so I suggest you learn the basics first.  There are lots of free tutorials and good books out there.  Suggest you invest some time on them.
0
 
johanntagleCommented:
If you choose something like PHP, there sample scripts on url redirection at http://www.hotscripts.com/category/scripts/php/scripts-programs/redirection/url-based/.  Just register, it's free.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now