The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Search Bar Question
gigsearcher
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 05:15 AM