Search Bar Question |
Search Bar Question |
gigsearcher |
Jun 19 2016, 04:53 AM
Post
#1
|
Group: Members Posts: 1 Joined: 19-June 16 Member No.: 24,345 |
Hi guys,
I'm trying to find out if there's a way to add an HTML search box to my website that will open up the page searched for? Example: I have the search box on the homepage. I have pages, each with the name of a British city. If a visitor using the search box searches for "London" they will be taken directly to http://mysite.co.uk/london. I can't find a search box code anywhere that will allow me to do this. Is it even possible? Thank you in advance, Steve. |
CharlesEF |
Jun 19 2016, 05:40 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
In theory, yes it can be done. But are you sure you want to do this? What happens when a user enters only part of name and multiple results are returned?
If only 1 result is returned then you could redirect to that city. If more than 1 result is returned then you could show the results on a page. Once the user clicks on 1 of the results then you could redirect to that page. If your server side language is PHP then you could use the PHP 'header' command. |
Lo-Fi Version | Time is now: 26th April 2024 - 09:14 AM |