Problem with the length of URL address

K

Kamyk

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
 
S

Steve Pugh

Kamyk said:
<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
 
D

Dylan Parry

Kamyk said:
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.
 
P

Philip Ronan

Jan said:
Kamyk ... output:


1024 is maximum.

Where did you get that number from?

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

Jan Faerber

Philip Ronan ... output:
Where did you get that number from?

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

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>
 
J

Jan Faerber

Lauri Raittila ... output:
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>
 
P

Philip Ronan

Jan said:
[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).
 
J

Jan Faerber

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top