false logic has asked for the wisdom of the Perl Monks concerning the following question:

i am extremely new to the whole perl/html/cgi/sql etc etc scene.

i have a form that has five separate pull down menus. it is at the top of a page that has about 150 different names of ships, and data related to them (the fact that they're ships isn't relavant to the problem... i just thought that'd be nice to know). the user is supposed to select ONE of ships from ONE of the menus. when they do, it is then supposed to take them to the place in the page that is about that ship.

i have the form all set up, along with a pretty little submit button. i also already have the "a name=ship_name" tags in all the places.

i was wondering what i should put in the FORM tag besides METHOD=POST. i don't know what the action should be, where the data goes, or what i should do with the data once the submit button is hit. if possible, i would like to contain the code within the document i have the rest of the code written in (which is a cgi document).

thanks in advance for your help. if i didn't give enough information, feel free to email me at blue_serge@hotmail.com

-cassie

Replies are listed 'Best First'.
Re: form question
by Hot Pastrami (Monk) on Aug 30, 2000 at 00:05 UTC
    Well, ACTION= will point to your CGI script... where it will send all your form data. For example:
    <FORM NAME="test" ACTION="./cgi-bin/process.cgi" METHOD=POST>
    The subject of CGIs as a whole is far too broad to discuss in a single posting, but there are many resources online to help with the nitty gritty... here's a couple:
    ...I haven't really looked at these sites in depth, I just did a quick web search. There are tons more out there, just search for "perl CGI programming" on any number of search engines (I used Yahoo). Also, feel free to post specific questions here anytime, a lot of these crazy Perl monks know their stuff.

    Alan "Hot Pastrami" Bellows
    -Sitting calmly with scissors-
Re: form question
by chromatic (Archbishop) on Aug 30, 2000 at 01:36 UTC
    One of the nifty things about ACTION is that if you don't specify it, the data will be sent to the current document. (This is handy if you have one CGI script that, depending on what input it gets, displays a lot of different pages -- including a no-input default page.)
Re: form question
by cwest (Friar) on Aug 30, 2000 at 00:01 UTC
    What to put in the fort tag?
    <form method=post action=program.cgi>
    Change program.cgi to your program name.

    Next, in your program you might do something like this:

    use CGI; my $cgi = CGI->new; my $param = { map { $_ => $cgi->param($_) } $cgi->param }; print "Location: http://your.domain.com/yourpage.html#".$param->{ship_ +name};
    Of course... you might not do that either.
    --
    Casey