Jump to content

Recommended Posts

For some reason I am only able to read at the most 200 post variables with PHP. I had over 200 post variables and when I submitted it I did a var_dump on $_POST and only the first 200 could be seen. Before, even if I had a 1000 it still worked. I think somehow my settings have changed. Does anyone know where I would edit a setting such as this? Thanks.

There is no setting which limits the number of $_POST vars that can be set. However there is a memory limit for POST data which is 8MB by default.

 

Howver why do yoiuneed to to set 200 or even 1000 $_POST vars! Surrely you're not going to have that big of a form?

There is no setting which limits the number of $_POST vars that can be set. However there is a memory limit for POST data which is 8MB by default.

 

Howver why do yoiuneed to to set 200 or even 1000 $_POST vars! Surrely you're not going to have that big of a form?

Yea, its a big form to edit a lot of stuff in the database at once. They are array post values so it's really just 5-6 main post data with lots of array values inside each post.

 

Where would I edit the memory limit? I find it weird if that is what is limiting me because every time I dump the $_POST I see 200 values max, no matter the size of the variables. If that was really what was limiting me, wouldn't it sometimes read 180 values, or sometimes 210 values, etc.? Not sure why it always reads only 200.

There are patched (or it might be a wrapper) versions of php (in a funny attempt to get the language to add security to an application) that do limit the number of variables at 200. You can ask your web host to increase the value or disable the limit.

 

And as already stated, you should probably not be placing that much data on one form page.

There are patched (or it might be a wrapper) versions of php (in a funny attempt to get the language to add security to an application) that do limit the number of variables at 200. You can ask your web host to increase the value or disable the limit.

 

And as already stated, you should probably not be placing that much data on one form page.

Hmm, the form is not something that is used by regular users of the site, only admins, so its not something that would be used a lot. Or would it still be a bad idea to have that many post variables despite that? I could probably break up the form, but I'd still want to be able to set more than 200. I have a dedicated server with cPanel, WHM, and httpd.conf access, but I don't think I was able to find where to edit it. Does anyone have any experience with that?

 

 

What is the best estimated time a user would take to fill them all out? I usually stop after filling out 5 fields, but that's just me ;)

It's probably not the kind of form you're thinking of. :P It's more of a list of stuff from the database that makes it more easy to edit. It's also only for admins, so you won't get a ton of people using this form.

The PHP I am aware of that does this is the hardened php project (not sure if this is the correct link to it - http://www.hardened-php.net/)

 

I recommend ONLY getting your php from php.net (though there are some hints that php.net THINKS some of the things being done in the Hardened php are wise and are including them in php6.)

 

Here is the setting in question (it's in the php.ini) -

 

hphp.post.max_vars

 

    *

      Type: Integer

    *

      Default: 200

 

The PHP I am aware of that does this is the hardened php project (not sure if this is the correct link to it - http://www.hardened-php.net/)

 

I recommend ONLY getting your php from php.net (though there are some hints that php.net THINKS some of the things being done in the Hardened php are wise and are including them in php6.)

 

Here is the setting in question (it's in the php.ini) -

 

hphp.post.max_vars

 

    *

      Type: Integer

    *

      Default: 200

 

Weird, I couldn't find that. I also googled just now and it can also be suhosin.post.max_vars yet I don't see that in my php.ini either. Nothing close to "max_vars". What other file could it possibly be in?

The settings could also be in httpd.conf

I found out its set at 200 by default, but supposedly it won't show in your ini file, I added these lines:

suhosin.post.max_vars

suhosin.request.max_vars

with the max post vars you want it and it works now. :)

Thanks for the assistance.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.