Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Design and Webmaster Issues
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-11-2000, 06:47 PM   #1
Doc
Registered User
 
Join Date: Jul 2000
Location: The Lonestar State
Posts: 233
Exclamation Help with a menu script?

I'm having problems getting a drop down menu script to work properly. I'm pretty new at this aspect of webdesign. http://geekvillage.com/ubb/biggrin.gif

I've tried 2 different things and gotten two problems, but I need some help figuring out what the solution is.

its at http://www.profitstogo.com/test.htm

Can anyone tell me what's wrong? (in idiot terms)

thanks!
Doc is offline   Reply With Quote
Old 12-11-2000, 07:13 PM   #2
AK
Registered User
 
AK's Avatar
 
Join Date: Jan 2000
Location: Lkpg, SE
Posts: 562
Question

Impossible to say without access to the source codes.
AK is offline   Reply With Quote
Old 12-12-2000, 04:59 AM   #3
icehouse
Registered User
 
Join Date: Dec 2000
Location: NH
Posts: 6
Lightbulb

It will work with IE, however with some versions of netscape you may need to add a 'go' or similar button afterwords for users to click on after they make a choice.
icehouse is offline   Reply With Quote
Old 12-12-2000, 05:17 AM   #4
AK
Registered User
 
AK's Avatar
 
Join Date: Jan 2000
Location: Lkpg, SE
Posts: 562
Unhappy

Ah - I see you have changed the menu script from CGI to JavaScript. Works like a charm (both NS and IE), but I guess you knew that already?
AK is offline   Reply With Quote
Old 12-12-2000, 12:47 PM   #5
Doc
Registered User
 
Join Date: Jul 2000
Location: The Lonestar State
Posts: 233
Unhappy

I was trying something else for a moment

the reason it works is that I didn't make it myself http://geekvillage.com/ubb/biggrin.gif

ok...so I switched it back to the other type I was trying...the manual one with the button....

source code?

this?


<body>

<form method="POST" action="/cgi-bin/menujump.cgi">
<p><select size="1" name="D1">
<option selected value="Choose ONe">Choose ONe</option>
<option value="Allclicks">AllClicks</option>
</select><input type="submit" value="Submit" name="B1"></p>
</form>

</body>

</html>


the script I want to use is called menujump.cgi...it looks like this...

#!/usr/local/bin/perl
################################################## #############
# This is straight forward script you define text file #
# with the separated with the AND (@) sign #
# The first part will be the link...and the second part #
# would be the name #
# like this #
# http://www.yahoo.com@Yahoo #
# |__________________| |___| #
# | | | | #
# The link The Name #
# #
# And you would call this like this: #
# <!--#exec cgi="../cgi-bin/menujump.cgi" --> #
# #
# That is all to it. #
# #
# Do all you want with it.... http://geekvillage.com/ubb/wink.gif> #
# #
################################################## #############

if ($ENV{'QUERY_STRING'** =~ /jump/) { &jump; **
else { &menu; **
################################################## #############
# This is the section that reads the text file and puts #
# it in the option of pull down menu #
################################################## #############
sub menu {
unless (open(MYFILE, "menu.txt")) {
die ("cannot open input file file1\n");
**
# if the program gets this far, the file was
# opened successfully
print "Content-type: text/html", "\n\n";
$line = <MYFILE>;
($link_dest, $link_name) = split ("\@", $line);
print "<FORM METHOD=POST ACTION=\"http://www.profitstogo.com/cgi-bin/menujump.cgi?jump\">";
print "<select name=\"url\" size=\"1\">";
while ($line ne "") {
print "<option value=\"$link_dest\"\> $link_name";
$line = <MYFILE>;
($link_dest, $link_name) = split ("\@", $line);
**

print "</select><input type=\"Submit\" value=\"Take Me There\"></form>";
**
################################################## #############
# This is the section that does the jump #
# This section was borowed from the script jump.cgi that i got#
# from a guy on the newsgroups....if this is you who wrote #
# this script and don't want me to use it here please feel #
# free to send me mail jarekg28@hotmail.com and i'll take it #
# out.
################################################## #############
sub jump {
# Read in all the variables set by the form
&parse_form;
$gotourl = $FORM{'url'**;
print "Location: $gotourl\n\n";
sub parse_form {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'**);
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name** = $value;
**
**
**

you define the variables in a txt file called menu.txt...I have it like this so far...
http://www.profitstogo.com@Choose ONe http://www.profitstogo.com/allclicks.htm@Allclicks

I hope that's what you were asking for....

Also....if I can do this without the script or an easier way...that's fine with me.... http://geekvillage.com/ubb/smile.gif...
Doc is offline   Reply With Quote
Old 12-12-2000, 02:19 PM   #6
AK
Registered User
 
AK's Avatar
 
Join Date: Jan 2000
Location: Lkpg, SE
Posts: 562
Unhappy

Yes, it was the latter code I meant... The script works fine on my server, so the problem is not in the code.

I don't think you are using the exact code you provided though. If you were, the script's output (the source code you provided first) would be:
Quote:
<FORM METHOD=POST ACTION="http://www.profitstogo.com/cgi-bin/menujump.cgi?jump"><select name="url" size="1"><option value="http://www.profitstogo.com"> Choose ONe
<option value="http://www.profitstogo.com/allclicks.htm"> Allclicks </select><input type="Submit" value="Take Me There"></form>
...but the code on your page looks, like you mentioned, like this:
Quote:
<form method="POST" action="/cgi-bin/menujump.cgi">
<p><select size="1" name="D1">
<option selected value="Choose ONe">Choose ONe</option>
<option value="Allclicks">AllClicks</option>
</select><input type="submit" value="Submit" name="B1"></p>
</form>
Note the difference in the <FORM ACTION... URLs between the first an second code snippets, and also the different names in the SELECT tag ("url" and "D1" respectively). So, without access to the exact code you are using, It's very hard for me to help you solve the problem.

[This message has been edited by AK (edited 12-12-2000).]
AK is offline   Reply With Quote
Old 12-12-2000, 04:09 PM   #7
Doc
Registered User
 
Join Date: Jul 2000
Location: The Lonestar State
Posts: 233
Unhappy

I'm getting the feeling I'm totally off!

Looks like I'm gonna have to break down and go do some reading... http://geekvillage.com/ubb/frown.gif


Thanks for helping me AK.
Doc is offline   Reply With Quote
Old 12-12-2000, 04:26 PM   #8
Doc
Registered User
 
Join Date: Jul 2000
Location: The Lonestar State
Posts: 233
Unhappy

well...i found something that does what I want, without my needing to understnad it completely...

check out http://www.profitstogo.com/new_page_1.htm

however, i now understand the importance of learning http://geekvillage.com/ubb/smile.gif....i'm gonna have to work on this stuff so it won't be a problem in the future...
Doc is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PPC MetaSearch/Tracking Script For Sale LaNMaN Archives of old posts from Let's Barter/Trade, Buy, & Sell 0 09-05-2001 12:57 PM
Tell a Friend + Mailing List Script click2mo Web Design and Webmaster Issues 0 08-17-2001 12:01 PM
Need someone to write me a script rhizome Archives of old posts from Let's Barter/Trade, Buy, & Sell 1 04-20-2001 02:20 PM
Linking to menu script vs. including it in html cyburrr Web Design and Webmaster Issues 4 03-06-2001 08:12 AM
"Make This Site your HomePage" Script? click2mo Web Design and Webmaster Issues 6 07-13-2000 10:03 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 03:11 AM.


GeekVillage.com is copyright © 1998-2014 iOnline Web Design. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.