Page 1 of 1

Enter A Keyword into a text box and redirected to a page?

Posted: Sun Jan 11, 2009 6:00 pm
by TGP
Hello, I am hoping it is possible for a user visiting my website to enter a product name into a box hit go and be taken to the page with the product on. For example, if i was selling fruit (lol), and the user entered 'banana' into the box and clicked go they would be taken straight to the page that sells bananas.

It seems pretty simple does anyone know if this is possible?

Thanks a lot

Re: Enter A Keyword into a text box and redirected to a page?

Posted: Sun Jan 11, 2009 7:29 pm
by requinix
Uh... yes, it is possible. Quite. The generic term for something like that is "searching".

At the very least, you have a list of keywords and pages: someone enters some keywords (of which you might only keep one), you search that list for the keyword entered, and redirect to whatever the corresponding page is.
Or you have a dynamic page with a URL like "show.php?word=banana" that immediately displays whatever it should for "banana".

Re: Enter A Keyword into a text box and redirected to a page?

Posted: Mon Jan 12, 2009 9:10 am
by TGP
Hi sounds good, could you please describe how to achieve this if you could?

Id greatly appreciate it.

Re: Enter A Keyword into a text box and redirected to a page?

Posted: Mon Jan 12, 2009 9:31 am
by jaoudestudios
Is your content stored in a database?

Re: Enter A Keyword into a text box and redirected to a page?

Posted: Mon Jan 12, 2009 10:17 am
by TGP
All my pages are just static .html

Is there no script that will do something like if='banana' go to /banana.html?

Thanks for the help :D

Re: Enter A Keyword into a text box and redirected to a page?

Posted: Mon Jan 12, 2009 10:25 am
by jaoudestudios
There are a few ways of doing it, javascript might be able to do it, check google for 'jquery search' as someone might have already written a library. PHP could read the files at runtime and display results from that - you would have to bench mark it as it might be slow.