in reply to Perl CGI question

I usually just query the DB. Then loop through the results and do a print "<option value=\"" . $fields[0] . "\">" . $fields[1] . "</option>" Before and after the loop don't forget to put the <select> tags. If you can figure out HTML::Mason it might work. I've never used it, so I really can't comment on it. Edit: Can someone tell me how to display square brackets without PM thinking they're a weird link or something. Thanks.

Replies are listed 'Best First'.
Re^2: Perl CGI question
by kutsu (Priest) on Oct 25, 2004 at 18:09 UTC

    Use code tags (<code></code>) to display code and your print could more easily be coded as print '<option value="' . $fields[0] . '">' . $fields[1] . '</option>'; #changed " for ' so you don't have to use \"

    "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

      In times where <code> isn't appropriate, use &#91; for [ and &#93; for ].