I'm not sure quite where you are from the standpoint of understanding your way around a CGI application, but the question leads me to believe that you're just starting to get your feet wet. That being the case, I hope the following suggestions get you started in the right direction:
- CGI stands for Common Gateway Interface. It's a set of tools that can be manipulated by an application to generate dynamic HTML that gets presented to the browser. CGI is programming language independent; a CGI application could be programmed in Perl, or C, or most other server-side languages. We here tend to favor Perl for various reasons, but YMMV.
- The CGI application (in this case in the form of a Perl script) generally does two things. First, it generates HTML. Second, it processes GET and POST input from forms. "Processes" is a terse way of saying it reads the input, decides what to do with it, does what it's supposed to do with the input, and then responds to the results of said processing by outputting more HTML to the browser.
- A CGI application doesn't necessarily HAVE to output a lot of HTML. A form could be hard-coded HTML, and the HTML that gets sent out in response to the form input could also be hard-coded HTML from a file or templating system. But that's a little more advanced topic.
- It is prudent to useCGI. You shouldn't be trying to read and deal with the low level stuff required to safely read form data. CGI.pm can also output HTML, though there are usually easier ways to accomplish that via a templating package.
- A drop down menu is a HTML entity that exists within a form. The script still has to know what to do with the form data.
- Forms don't respond immediately to the selection of a drop-down item without the user clicking "submit" unless there is some client-side programming too, for example, with Javascript or one of the newer client-side flavors of the day.
- If you're interested in learning to program, and gaining an understanding of the topics I touched on here, get a decend CGI programming book, such as the Mouse book (CGI Programming with Perl, I believe it's called, by O'Reilly & Assoc.). A later edition is preferable as much has changed over the years. Also reading CGI is very important. You can't just guess at all this and hope it will work out.
I hope some of this helps. If programming turns out to not be something you're interested in, you're better off finding someone who is interested in it, because the learning curve will quickly put you off if you're just looking for a quick solution. But if you have a desire to learn this stuff, stick around and enjoy. Just don't feel bad when it takes some work learning the art.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.