Wednesday, March 16, 2011

Re: [Pro. PHP Dev.] max_post_size

Hi again,

here's what I'm talking 'bout: https://picasaweb.google.com/ovidiu.alexa/RallyBigForm#5584704997907845538

this form is very long and I have no problem with javascript, jquery or html. this form work's fine. the problem is server-side. it's just too much damn information. the server has a limit somewhere but I don't know where to find and change the maximum post variables. ok, if I try to add another row it won't save it. if I remove one row and write some text in the big textarea that text will be saved.

It's kinda complicated, I don't even want to begin about jquery (even if I wanted to it's still a php group)

So, yeah...

Thanks for your concern :)

I'm doomed.

I'm not always right,
but I'm never wrong.
Please visit my site

On 3/16/2011 17:14, Heath Aiken wrote:
I don't know much about the server side of things, but if you are using jQuery to generate the form, then it stands to reason that you *need* javascript for the operation of your site / application. So, seeing how the proper operation of your form (with javascript disabled) is not a requirement, I think that you can solve this issue with jQuery.  I'm not a jQuery expert, so I can't give you details on how you would do this, but I would suggest taking the inputs of each "row", and serializing it (basically, all of the values of a row become a single POST variable), submitting it, and then exploding into the proper variables in your PHP script.

Because if the other solution requires you to monkey with unusual / non-standard Apache settings, then you reduce the portability of your code.

Just a thought off the top of my head.

--Heath


On Wed, Mar 16, 2011 at 11:02 AM, Ovidiu Alexa <ovidiu.alexa@gmail.com> wrote:
hi thank's for your reply.

i have a form that is generated with jquery, here's an example:

input date start, input date end, transport, room type, price, currency..... so the start and end dates are the reason that I need to make so many posts

if I have

01-01-2011 to 01-01-2012 with the gap of 2 days it will generate 182 rows. 182 * 11 variables / row = 2002 total vars. because I need to set the dates in between (01-01-2011 to 03-01-2011, 03-01-2011 to 05-01-2011 ... 01-01-2012)

so this number never reaches 100 in the database because the limit per post variables is limited . I don't know that limit. Wow do I know it's limited?

well if I post only 2 rows and after that I post some text in a textarea the text from that textarea will be saved, but if I post more than 100 rows that same text will not be saved. which goes to show that there is actually a limit for the maximum number of POST variables.

here's a brief description of my form

<form>
<input>title
<select, text, radio, checkbox> table with rows * 182
<textarea>some text
</form>


the output from that form should look like this in php;

1. $_POST['start_date'][0] .... $_POST['start_date'][182]
2. $_POST['end_date'][0] .... $_POST['end_date'][182]
3. $_POST['price'][0] .... $_POST['price'][182]
[...]
11. $_POST['last_minute'][0]...$_POST['last_minute'][182]

so 182 rows * 11 types of variables = 2002; but I only get 1089 variables (99 rows) in total + the title and other small stuff.


I think I need to count the total post vars to be sure..... and then search for that number on the server wherever it might be.

So i'm stuck here.

I don't know how to explain it better but I think you get the point.

Again I know this is not a php specific issue, it's a server issue or apache I don't know that... s***

It's driving me crazy as hell, so if you have any suggestions please help me :D

Cheers!







I'm not always right,
but I'm never wrong.
Please visit my site

On 3/16/2011 15:27, Robert Gonzalez wrote:
Are you talking about the number of elements in the form needing to be less than 200 or the number of rows in a textarea needing to be less than 200? Suhosin is a security patch designed to make PHP more secure. I can kinda see where one of these scenarios could be used to exploit your server that is why I am asking.

On Wed, Mar 16, 2011 at 5:33 AM, Ovidiu <ovidiu.alexa@gmail.com> wrote:
Is this off-topic? I am furious that I can't post more than 200
variables in a single form. I searched and searched and found
something like post_max_size, ok set that to 500M, restart apache,
nothing. max_upload_size, restart, nothing. phpinfo() confirms the
changes. so I found out a suhosin php project that is aware of this
problem and introduced suhosin.post.max_vars = 2000 and
suhosin.request.max_vars. Bummer, I don't have that version of php
installed on my server and I don't think that will change soon.

I have tried almost everything, even the server admin said the same
thing: post_max_size, restart apache.

Is this an older topic because I would like to read somethin' later
on.

So basically i have a jquery form that you can generate with 2
calendars: start date, end date. when you hit go, depending on the
number of days you set the gap, it will generate rows with select,
input, radio buttons and so on. the op then selects the correct data
for each row and submits the form. the saved rows to DB never reach a
total of 100 lines. below this generated form I also have 3 textareas.
if I put only 1-99 lines, then the texarea will be saved, else null.
so this comes to mind that there must be a limit of maximum post
variables, not post_max_size, 'cause now it's like 500M.

Have any of you ever reached this problem?
hmm maybe if I use a javascript to post them one by one with different
requests... or save all the post vars into a huge one, then in php
explode them by a limiter.... what do you think?

Please help me on this one...

Cheers!

--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHP@googlegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP

--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.
 
For information or project assistance please visit :
http://www.360psg.com
 
You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHP@googlegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.
 
For information or project assistance please visit :
http://www.360psg.com
 
You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHP@googlegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP

--
This group is managed and maintained by the development staff at 360 PSG. An enterprise application development company utilizing open-source technologies for todays small-to-medium size businesses.
 
For information or project assistance please visit :
http://www.360psg.com
 
You received this message because you are subscribed to the Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHP@googlegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP