Forum Moderators: phranque

Message Too Old, No Replies

Problem Passing Form Data

the amount of data i'm able to pass is limited

         

topr8

4:26 pm on Aug 29, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm trying to send a rather large html form and the receiving php script is not receiving all of the data.

I had thought that there was no limit to the amount of POST data that you can send ... so i'm pondering if there is perhaps a php setting or a setting on the server which is limiting it.

I've checked the page which contains the form, which is generated from the database and it has named the fields correctly.

However when i submit the form, the receiving php script is not receiving all the POST data.

The form fields are a sequence of:
hidden field which is an integer
hidden field which is a string around 10 characters
text field upto 128 characters
text field upto 128 characters

this is then repeated around 500 times

the fields are named thus
1_hiddenA
1_hiddenB
1_textC
1_textD
2_hiddenA
2_hiddenB
2_textC
2_textD
3_hiddenA
3_hiddenB
3_textC
3_textD

and so on down to around 500_textD

my php script is reading the data fine upto 251_hiddenA and from then on they are 'undefined' eg. i assume they haven't been passed.

any ideas on what is causing the limit ... thanks very much if you can help.

phranque

7:10 pm on Aug 29, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what is the value of the post_max_size parameter in the php.ini file?


https://www.php.net/manual/en/ini.core.php#ini.post-max-size

topr8

8:46 pm on Aug 29, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks very much for your reply ... that was set to 8M ... and assuming that stands for 8 Megabytes then there is no way i'm passing that much data!

phranque

9:13 pm on Aug 29, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



yes, that is the default value.

perhaps, as an experiment, you could try sending smaller field sizes and see if it accepts more fields/data

topr8

9:20 pm on Aug 29, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i reset it to both 24M and to 0 and neither made a difference.

i realise that i can work around this by processing the form in smaller quantities ... it is actually products within a category and any category that has less than 200 products there is no problem, all works fine.

so of course if a category has more than 200 products, i can easily just process 200 at a time ... however it is totally doing my head in! also this is for a very unsavvy client and if he can do all the updates on one page then all the better - anything complicated and i just get phone calls

topr8

9:11 pm on Aug 30, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks for your help ... it was a head banger ... however in the end i just did the easiest thing which was limit the data in the form and use multiple forms ... which works fine.

tangor

7:21 am on Aug 31, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



anything complicated and i just get phone calls

however in the end i just did the easiest thing which was limit the data in the form and use multiple forms


I have always found it better to limit what the client can do because all too often if you give them enough rope they will take shortcuts ... and the problems can then become extreme! Keeping input limited reduces the chance of user mistakes.

YMMV