Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

character limit in cgi.pm param() function?

by c (Hermit)
on Oct 23, 2001 at 02:55 UTC ( [id://120651]=perlquestion: print w/replies, xml ) Need Help??

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

is there a limit to the amount of characters that can be gathered from a form's <input type="text"> variable through cgi.pm's param() feature?

humbly -c

Replies are listed 'Best First'.
Re: character limit in cgi.pm param() function?
by cLive ;-) (Prior) on Oct 23, 2001 at 03:17 UTC
    Only, AFAIK, if you use the GET method to submit the form. ie, use POST to avoid restrictions placed by query strings:
    <FORM ACTION="whatever" METHOD="POST"> ... </FORM

    cLive ;-)

      Yes, to be safe, use POST. This might explain in more detail (found here.):

      Using the get method allows the form submission to be contained completely in a URL. This can be advantageous in that it permits bookmarking in current browsers, but it also prevents form data from containing non-ASCII characters such as "é" and "©". As well, the amount of form data that can be handled by the get method is limited by the maximum length of the URL that the server and browser can process. To be safe, any form whose input might contain non-ASCII characters or more than 100 characters should use METHOD=post.
        I just ran a test using © and é and get and it worked.

        Yes, non-ASCII chars are UU-encoded, but that doesn't mean they can't appear in the query string as UU-encoded chars.

        cLive ;-)

Re: character limit in cgi.pm param() function?
by fokat (Deacon) on Oct 23, 2001 at 05:31 UTC
    I don't know if this is helpful, but a couple of years ago I found that Netscape and IE (both under Win32) were choking on a form that was quite complex and long.

    Testing showed that if the amount of data in the POST exceeded 64K, the browser would hang. We were unable to reproduce this under other OSes (FreeBSD and BDS/OS at the time).

    I assume this is not the case nowadays, but my advice is for you to do some testing before going ahead if your text is that large.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://120651]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found