Problem with the length of URL address

Discussion in 'HTML' started by Kamyk, Mar 10, 2005.

  1. Kamyk

    Kamyk Guest

    Hello!

    I use such code
    <FORM action="web.asp" METHOD="GET">
    .....
    </FORM>

    Unfortunately the form is very sophisticated and have a lot of input fields.
    It makes the passing URL address very long and it has more than X thousand
    characters. That`s why I cannot pass all data I need after submitting the
    form. How to send whole data for each variable included in the form? Could
    you give me the example of such using? I am the beginner of writing in HTML.

    Thank you in advance

    Marcin from Poland
     
    Kamyk, Mar 10, 2005
    #1
    1. Advertising

  2. Kamyk

    Steve Pugh Guest

    "Kamyk" <> wrote:

    ><FORM action="web.asp" METHOD="GET">
    >....
    ></FORM>
    >
    >Unfortunately the form is very sophisticated and have a lot of input fields.
    >It makes the passing URL address very long and it has more than X thousand
    >characters. That`s why I cannot pass all data I need after submitting the
    >form. How to send whole data for each variable included in the form? Could
    >you give me the example of such using? I am the beginner of writing in HTML.


    method="post"

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Mar 10, 2005
    #2
    1. Advertising

  3. Kamyk

    Dylan Parry Guest

    Kamyk wrote:

    > I use such code <FORM action="web.asp" METHOD="GET"> ..... </FORM>
    >
    > Unfortunately the form is very sophisticated and have a lot of input
    > fields. It makes the passing URL address very long and it has more
    > than X thousand characters.


    Try using method="post" instead. You may have to change your form
    handler to deal with post data though.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Mar 10, 2005
    #3
  4. Kamyk

    Jan Faerber Guest

    Kamyk ... output:

    > It makes the passing URL address very long and it has more than X thousand
    > characters.


    1024 is maximum.



    --
    Jan

    http://html.janfaerber.com
     
    Jan Faerber, Mar 11, 2005
    #4
  5. Kamyk

    Philip Ronan Guest

    Jan Faerber wrote:

    > Kamyk ... output:
    >
    >> It makes the passing URL address very long and it has more than X thousand
    >> characters.

    >
    > 1024 is maximum.


    Where did you get that number from?

    The HTTP specification doesn't mention any specific limit. Instead it says
    this:

    > The HTTP protocol does not place any a priori limit on the length of
    > a URI. Servers MUST be able to handle the URI of any resource they
    > serve, and SHOULD be able to handle URIs of unbounded length if they
    > provide GET-based forms that could generate such URIs. A server
    > SHOULD return 414 (Request-URI Too Long) status if a URI is longer
    > than the server can handle (see section 10.4.15).
    >
    > Note: Servers ought to be cautious about depending on URI lengths
    > above 255 bytes, because some older client or proxy
    > implementations might not properly support these lengths.



    --
    phil [dot] ronan @ virgin [dot] net
    http://vzone.virgin.net/phil.ronan/
     
    Philip Ronan, Mar 11, 2005
    #5
  6. Kamyk

    Jan Faerber Guest

    Philip Ronan ... output:

    > Jan Faerber wrote:
    >
    >> Kamyk ... output:
    >>
    >>> It makes the passing URL address very long and it has more than X
    >>> thousand characters.

    >>
    >> 1024 is maximum.

    >
    > Where did you get that number from?
    >
    > The HTTP specification doesn't mention any specific limit. Instead it says
    > this:
    >
    >> The HTTP protocol does not place any a priori limit on the length of
    >> a URI. Servers MUST be able to handle the URI of any resource they
    >> serve, and SHOULD be able to handle URIs of unbounded length if they
    >> provide GET-based forms that could generate such URIs. A server
    >> SHOULD return 414 (Request-URI Too Long) status if a URI is longer
    >> than the server can handle (see section 10.4.15).
    >>
    >> Note: Servers ought to be cautious about depending on URI lengths
    >> above 255 bytes, because some older client or proxy
    >> implementations might not properly support these lengths.

    >
    >


    No, with PHP you find this:

    <q cite="http://www.zend.com/zend/spotlight/mimocsumissions.php">
    Although the GET method is very useful, it has a limit of approximately 1k
    (1024 characters). This means that any submission that can possibly be
    greater than 1024 characters (including the names of all of the variables,
    ampersands, etc.) must be done through the POST method, [...]
    </q>


    --
    Jan

    http://html.janfaerber.com
     
    Jan Faerber, Mar 11, 2005
    #6
  7. in alt.html, Jan Faerber wrote:
    > Philip Ronan ... output:
    >
    > > Jan Faerber wrote:
    > >
    > >> Kamyk ... output:


    > >> 1024 is maximum.


    > > The HTTP specification doesn't mention any specific limit. Instead it says
    > > this:


    > No, with PHP you find this:


    But OP was using asp. (action="web.asp")

    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
    Utrecht, NL.
     
    Lauri Raittila, Mar 11, 2005
    #7
  8. Kamyk

    Jan Faerber Guest

    Lauri Raittila ... output:

    > in alt.html, Jan Faerber wrote:
    >> Philip Ronan ... output:
    >>
    >> > Jan Faerber wrote:
    >> >
    >> >> Kamyk ... output:

    >
    >> >> 1024 is maximum.

    >
    >> > The HTTP specification doesn't mention any specific limit. Instead it
    >> > says this:

    >
    >> No, with PHP you find this:

    >
    > But OP was using asp. (action="web.asp")


    Yes, ASP:

    <q cite="http://www.oreilly.com/catalog/aspnut/chapter/ch06.html">
    If the form is written to use METHOD=GET, the form data is appended to the
    URL as an argument string. If the form contains many fields or if fields
    contain long strings of text, the complete URL can become very large and
    unwieldy. In addition, the limit of the number of characters submitted in a
    GET--typically about 2000--is much lower than in a POST.
    </q>



    --
    Jan

    http://html.janfaerber.com
     
    Jan Faerber, Mar 11, 2005
    #8
  9. Kamyk

    Philip Ronan Guest

    Jan Faerber wrote:

    > [URL length limit in GET requests]


    It makes no difference if you're using PHP, ASP, Perl, FORTRAN or anything
    else. Ultimately your server has to deal with HTTP requests from unspecified
    clients over the internet, so it should conform to the HTTP specification.
    You *might* find that a URL length of 2000 or even 4000 bytes works with
    *some* clients, but you should be prepared to encounter clients that are
    only compatible with shorter URLs.

    The PHP and ASP documentation just describes typical limits for the length
    of GET requests. I don't think these are meant as statements of an absolute
    upper limit for each language -- look at the wording: "it has a limit of
    *approximately* 1k" (PHP) and "the limit of the number of characters [is]
    *typically* about 2000" (ASP).

    --
    phil [dot] ronan @ virgin [dot] net
    http://vzone.virgin.net/phil.ronan/
     
    Philip Ronan, Mar 11, 2005
    #9
  10. Kamyk

    Jan Faerber Guest

    Philip Ronan ... output:

    > It makes no difference if you're using PHP, ASP, Perl, FORTRAN or anything
    > else.


    .... or Flash:
    PASSING VARIABLES FROM HTML TO FLASH VIA QUERY STRING
    <q cite="http://www.permadi.com/tutorial/flashQueryString/">
    The data to be passed is not long. I recommend less than 1024 characters.
    (The actual limit depends on the browser and the server.)
    [...]
    Each variable name and value pair is separated by a "=" sign; and an "&"
    sign separates the variables. You can have as many variable name and value
    pairs, but remember, there is a limit, and I recommend not more than 1024
    characters total (including the www URL part). After all, if you need more
    space, you should consider using other methods.
    </q>

    .... or CGI:
    <q
    cite="http://astroa.physics.metu.edu.tr/MANUALS/cgi_perl.tut/basics.html">
    5. Always use the POST method with your HTML forms

    There are 2 ways to get information from the client to the web server. The
    GET method takes all of the data from the forms and concatenates it onto
    the end of the URL. This information is then passed to the CGI program as a
    command line argument. Because the GET method has the limitation of being
    1024 characters long, it is best to use the POST method. This takes the
    data and sends it allong with the request to the web server, without the
    user seeing the ugly strings in the URL. This information is passed to the
    CGI program through standard in, which the program can easilly read from.
    To use the POST method, make sure that your HTML form tag has

    METHOD=POST (no quotes)
    </q>



    --
    Jan

    http://html.janfaerber.com
     
    Jan Faerber, Mar 11, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mitchua
    Replies:
    5
    Views:
    2,779
    Eric J. Roode
    Jul 17, 2003
  2. =?Utf-8?B?SG96aQ==?=
    Replies:
    1
    Views:
    6,983
    Ken Cox [Microsoft MVP]
    Jun 2, 2004
  3. Sam
    Replies:
    3
    Views:
    14,146
    Karl Seguin
    Feb 17, 2005
  4. Replies:
    2
    Views:
    5,946
  5. Dan Manes
    Replies:
    1
    Views:
    740
    David Browne
    Apr 23, 2006
Loading...

Share This Page