Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Site Functionality _ Search Bar Question

Posted by: gigsearcher Jun 19 2016, 04:53 AM

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.

Posted by: CharlesEF Jun 19 2016, 05:40 AM

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.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)