Pulldown menu--one for all pages - How do I refer to this code in all pages?

They have: 89 posts

Joined: Jul 1999

I think I've got the code written ok; please verify:
(I know it's long~bear with me....)

<!--begin pull down menu-->

<SCRIPT LANGUAGE="JavaScript">

<!-- Hide from old browsers
function linkto(n) {
window.location=document.forms[0][n].options[document.forms[0][n].selectedIndex].value;
}
// Stop hiding from old browsers -->

</SCRIPT>

<FORM name="guideform">
<font size="2">
<SELECT NAME="guidelinks" SIZE="1" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<OPTION VALUE="#" SELECTED>Click HERE For Pull Down Menu

<OPTION VALUE="search.htm">SEARCH
<OPTION VALUE="http://2kcut.com/brandindex.html">Brand Index
<OPTION VALUE="http://2kcut.com/benchmade.html">Benchmade Knives
<OPTION VALUE="http://2kcut.com/beretta.html">Beretta Knives
<OPTION VALUE="http://2kcut.com/boker.html">Boker Knives
<OPTION VALUE="http://2kcut.com/browning.html">Browning Knives
<OPTION VALUE="http://2kcut.com/buck.html">Buck Knives
<OPTION VALUE="http://2kcut.com/camillus.html">Camillus Knives
<OPTION VALUE="http://2kcut.com/case.html">Case Knives
<OPTION VALUE="http://2kcut.com/chefschoice.html">Chef's Choice
<OPTION VALUE="http://2kcut.com/coldsteel.html">Cold Steel Knives
<OPTION VALUE="http://2kcut.com/colt.html">Colt Knives
<OPTION VALUE="http://2kcut.com/columbiariver.html">Columbia River Knives
<OPTION VALUE="http://2kcut.com/gerber.html">Gerber Knives
<OPTION VALUE="http://2kcut.com/kabar.html">Ka-bar Knives
<OPTION VALUE="http://2kcut.com/kershaw.html">Kershaw Knives
<OPTION VALUE="http://2kcut.com/microtech.html">MicroTech Knives
<OPTION VALUE="http://2kcut.com/ontario.html">Ontario Knives
<OPTION VALUE="http://2kcut.com/puma.html">Puma Knives
<OPTION VALUE="http://2kcut.com/remington.html">Remington Knives
<OPTION VALUE="http://2kcut.com/schrade.html">Schrade Knives
<OPTION VALUE="http://2kcut.com/smithwesson.html">Smith & Wesson Knives
<OPTION VALUE="http://2kcut.com/sog.html">SOG Knives
<OPTION VALUE="http://2kcut.com/spyderco.html">Spyderco Knives
<OPTION VALUE="http://2kcut.com/valor.html">Valor
<OPTION VALUE="http://2kcut.com/victorinox.html">Victorinox Knives
<OPTION VALUE="http://2kcut.com/wenger.html">Wenger
<OPTION VALUE="http://2kcut.com/western.html">Western Knives
<OPTION VALUE="http://2kcut.com/winchester.html">Winchester Knives
<OPTION VALUE="http://2kcut.com/order.html">Place Your Order
<OPTION VALUE="addguest.htm">Guestbook
<OPTION VALUE="feedback.htm">Feedback
<OPTION VALUE="http://home.swbell.net/accaw/weideman.html">Weideman Knives

</SELECT>
</font>
</FORM>

<!--end pull down menu code-->

+ / + / + / + / + / + / + / + / + / + / + /

I have two questions, really....

1) how do I create the file that contains this?
- filename?
- anything before or after it?

2) how do I refer to it in all my (70+) pages?

Appreciate your time. I hope you're not sick of this discussion topic by now.... (I'm impressed with the fact that all these questions get answered, BTW.)

----------
[email protected]
Millennium Cutlery: pocket knives & other cutlery-25% below retail

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

If your web host allows SSI, that is probably your best route. This way, you can place all that code into a single text file and then just call it on every page with an SSI command. Often, the cammand is:

<!--#include virtual="filename.txt"-->

With the filename being the file with the code you want on every page.

Hope this helps. Smiling

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

They have: 89 posts

Joined: Jul 1999

ok, forgive me if I sound... whatever, but here's what I've done so far. I've created a file named pulldowntest.html. It only contains the pulldown code from above (NO <HTML> </HTML> tags, right?

Then I created a test file from one of my existing pages. Where I'm wanting the pulldown menu to be, I've inserted:

<!--#include virtual="http://2kcut.com/pulldowntest.txt"-->

I must be missing the point somewhere. What else do I need to do? I just know I'm very close, but a piece is missing from the puzzle.

Again, thanks for your time and your help.

----------
[email protected] 2kcut.com
Millennium Cutlery: pocket knives & other cutlery-25% below retail

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

They have: 2,390 posts

Joined: Nov 1998

OK the pulldownmenu.txt file should not have any HTML tags but the actual code for the menu.

The file with the <!--#include virtual="http://2kcut.com/pulldowntest.txt"--> should be a standard HTML file. If it does not work it might because your host does not support SSI or you have not renames your HTML file .shtml

Try that and see how it goes...
JP

----------
The Webmaster Forums General Administrator
[red]Why not visit:[/red] The Next Step in Website Development - http://www.what-next.com

They have: 89 posts

Joined: Jul 1999

EUREKA!!!! Bingo, Ringo!!!! Woohoo!!!

That was IT!

I am soooo thrilled! You have made my day! my week!
Thank you, thank you, thank you!!!! : )

----------
[email protected] 2kcut.com
Millennium Cutlery: pocket knives & other cutlery-25% below retail

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

They have: 2,390 posts

Joined: Nov 1998

You are welcome Smiling
JP

----------
The Webmaster Forums are part of the Web Currents Network.
The Next Step in Website Development - http://www.what-next.com

They have: 89 posts

Joined: Jul 1999

ok, JP. I think we're getting somewhere. I had heard that .shtml somewhere before.

[please bear with me, as I'm trying very hard to understand this...] does my, let's call it: atest.html file need to be renamed: atest.shtml ? then it should work?
.......
I just took a minute to change my atest.html to atest.shtml, which refers to the:
<!--#include virtual="http://2kcut.com/pulldowntest.txt"-->

(which is in a file called pulldowntest.txt)

but I get an error message:
[an error occurred while processing this directive]

Did I still miss something? Is anything supposed to go before or after: <!--#include virtual="http://2kcut.com/pulldowntest.txt"-->?

My domain host is MyFreeOffice. I guess it's possible they don't support SSI, but they have a whole help section on it, so I don't know. I have a feeling they do.

please don't give up on me Sad

----------
[email protected] 2kcut.com
Millennium Cutlery: pocket knives & other cutlery-25% below retail

Military & Combat Knives. Hunting & Fishing Knives. Pocket Knives.
Kitchen Cutlery. Sharpeners.

Enter our Monthly Drawing!!

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

It appears SSI is enabled because you got an SSI error:
[an error occurred while processing this directive]

I think what you want to do now is use a relative link to the file, rather than an absolute url. I believe the SSI command expects something on the local server and doesn't take a full url. Try either:

<!--#include virtual="/pulldowntest.txt"-->

or

<!--#include virtual="pulldowntest.txt"-->

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.