PDA

View Full Version : Adding a GoTo menu that the visitor fills in



motoxxx
12-13-2006, 05:03 AM
Is there some whay that I can add a Go menu (or something like one) that will allow the visitor to fill in their two letter state code (example WA, TN, TX , AZ etc).

I have different areas of my sites that are designed for specific states and I really don't want to have a dropdown menu that has 50 choices in it. It would be better if the visitor could just type in their two letter state code and have it automatically take them to the proper section.....

Naval????
Bethers???
Pablo???

navaldesign
12-13-2006, 05:25 AM
You need a form and a script for that. A simple form, with only one filed /state) and a submit button. The form action should be set to a redirect script. Look at this thread, particularly at post #10 : http://www.vodahost.com/vodatalk/forms/12979-form-links.html


Your pages should be saved as xy where xy are the two initials of the state.

motoxxx
12-13-2006, 08:10 AM
Hmmmmmmmmmmmm OK.

Gonna give this a shot.Thanks Naval!

Andy128
12-13-2006, 12:38 PM
either way you go--- I see a lot of typing (or cut /paste /modify) in your future.LOL

Andy

Collectors-info
12-13-2006, 07:07 PM
Hi, itís only a curiosity thing. But do you deal with clients from outside the US?
I am only thinking that many wonít have a clue what area the abbreviation is from.
Only an idea! Maybe a small (image map) with the links to different areas of the states.

navaldesign
12-13-2006, 07:38 PM
either way you go--- I see a lot of typing (or cut /paste /modify) in your future.LOL

Andy

Why ?

Andy128
12-13-2006, 10:18 PM
50 states and 50 links comes to mind.

Andy

navaldesign
12-14-2006, 05:01 AM
50 states and 50 links comes to mind.

Andy

The script and form require no effort at all.

The links are automatically built by the script, which is only a few lines. The form, as motoxx wants it, will only contain a text field, let's call it "state", limited to two chrs, and a submit button. The visitor fills in the state initials, so there is no typing. The form submits to the, let's call it, "state.php" script.
If one wants a dropdown with the states, it can be easily imported from any of the existing forms on the web. For example, you can import it from here (http://www.vodahost-italy.com/franchiseexplosion/form.html).
simply using BV's import html tool.

The script itself is:

<?php
$state= $_POST['state'];
$link = $state;
if(file_exists($link))
{
header("Location: $link");

}
header("Location: nostate.html");
?>

where "nostate.html" is a very simple page that informs the visitor if there is no product (or company or service) related to that state. This way you avoid the script linking to a state page that doesn't exist.

The pages for every state should be like LA.html, FL.html because that's how mottoxx wants the visitor to fill in the form.

The only actual work is building the pages themselves.

motoxxx
12-14-2006, 07:40 AM
The only insurance and such that I do outside of the US is Travel insurance. My target market is pretty much all US based unless someone is looking for travel coverage from outside of the US.

Naval, here is a bit of a dilema about the magnificent thing you have come up with...

Part of my SEO that works very well for me is how I have the state specific pages named. If I name each page the same as the two letter abbreviation I am going to lose this. Example, If I am selling health insurance in Florida, the page name would be domainname.com/floridahealth.html
The SEs look into the longer tail search terms of my pages and I get a bunch of business because of this.

I am not affraid to place 50 links on the site or maybe have a bit of code that looks into a folder on the FTP and tells the state abbreviation where to go.

I am totally new at HTML and I know this isn't anywhere near correct but maybe you'll get my meaning....some thing sort of like this.

if " "="FL" redirect to http://www.domainname.com/floridahealth.html
if " "="GA" redirect to http://www.domainname.com/georgiahealth.html

Can these links possibly sit in some sort of a folder on the FTP or can they just sit in the page html?

navaldesign
12-14-2006, 08:19 PM
You can use a dropdown menu, with the full names of the states, or else create in the script, an array, where the keys are the state initials, and the values are the links, or even simply the full state name. In the first case the link is already in the array, in the second, it is created as in the previous post, with a concatenation of the state name and the word "health"