Maximum number of parameters to pass?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toughman
Forum Newbie
Posts: 2
Joined: Mon Apr 27, 2009 2:59 am

Maximum number of parameters to pass?

Post by toughman »

I have a script needs to pass parameters to itself after user clicks a button in order to add more records. However, the number parameters to pass will getting bigger if the user trys to add more records.

Ex. http://www.abc.com/record.php?a1=xxx&b1 ... b2=yxy&a3=........

My script works when the number of the parameters is under 68 but it doesn't work when it is 72.

It will show the error message: "Internet Explorer cannot display the webpage"

Can anyone please tell me why and how to overcome this problem?

Thanks,

Roger
toughman
Forum Newbie
Posts: 2
Joined: Mon Apr 27, 2009 2:59 am

Re: Maximum number of parameters to pass?

Post by toughman »

Sorry.

I found my problem. The maximum length of a URL in Internet Explorer is 2,083 characters.

If more than 2083, use post.

<form action="myscript.php" method="POST">
...
</form>
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Maximum number of parameters to pass?

Post by pickle »

I really think you need to re-think you're approach. If a user is adding a field, why not just have that one field to be added in the URL, rather than all fields they've ever added?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply