Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello All, I have an HTML form that collects information the user inputs, and I have an area where they can enter comments wich can be up to 500 words. Once they post it it is sent to a CGI script that puts the information in a MySQL database. What I need to know is how to get the 500 words of text from the HTML form to the CGI script. Do I really need to place the entire string in the URL along with the other much smaller fields. Seems like there could be a better way. It would be a BLOB in the database if I can get it there. Thanks!

Replies are listed 'Best First'.
Re: CGI help.
by tcf22 (Priest) on Dec 12, 2003 at 21:22 UTC
    Use the CGI module to capture the data. Also use the POST method to avoid sending the data in the URL.

    Form:
    <FORM action="handler.cgi" method=POST> <TEXTAREA name="textarea1"></TEXTAREA> <input type="submit" value="Submit"> </FORM>
    CGI:
    use CGI; my $cgi = new CGI; my $user_input = $cgi->param('textarea1');

    - Tom

Re: CGI help.
by sauoq (Abbot) on Dec 12, 2003 at 21:22 UTC
    Do I really need to place the entire string in the URL along with the other much smaller fields.

    This isn't really a Perl question, but... use POST instead of GET. (Change your form's "method" attribute.)

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: CGI help.
by bear0053 (Hermit) on Dec 12, 2003 at 21:14 UTC
    You don't need to post it in the url, you could always use the GET method to retrieve the form variables. UPDATE: i meant use POST instead of get in order to not send in the data appended on the url