esport Posted September 30, 2009 Share Posted September 30, 2009 Hi guys, This is a strange one that I haven't ever come across. I have a loop that generates rows of form input fields. echo '<table>'; for($i=0; $i<$num_entries; $i++){ echo '<tr>'; echo '<td><input name="expense_details[]" type="text"></td>'; echo '<td><input name="expense_amount[]" type="text"></td>'; echo '<td><input name="expense_date[]" type="text"></td>'; echo '<td><input name="expense_id[]" type="text"></td>'; echo '<tr>'; } echo '<table>'; The user can add or minus the amount of $num_entries before submitting the actual form. However I can generate up to 30 rows before things go wierd. When I submit the form, for some reason I cant access the post data anymore. I know the form is being posted because it refreshes the page, but it doesnt look like it is passing the data across. Is there a limitation on how many form objects you can post? Any ideas would be good. Thanks daniel Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/ Share on other sites More sharing options...
trq Posted September 30, 2009 Share Posted September 30, 2009 I don't see any <form> definition? Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-927519 Share on other sites More sharing options...
esport Posted September 30, 2009 Author Share Posted September 30, 2009 here is the form def. <form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="expenses" enctype="multipart/form-data" > Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-927524 Share on other sites More sharing options...
prasanthmj Posted September 30, 2009 Share Posted September 30, 2009 I guess the max post size depends on the upload_max_filesize and post_max_size setting in your php.ini file. Also the LimitRequestBody setting in Apache configuration (if you are using Apache) Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-927618 Share on other sites More sharing options...
PFMaBiSmAd Posted September 30, 2009 Share Posted September 30, 2009 If the $_POST array is empty (have you checked exactly what you are getting using a print_r() statement?), you are likely exceeding the post_max_size setting, especially if you are uploading file(s) (your form tag implies that with the enctype="multipart/form-data" tag.) If so, either the post_max_size setting is too small for the expected amount of data or someone attempted to set the post_max_size setting and used an invalid syntax and actually resulted in a very small value instead of the expected value. Exactly what does a phpinfo(); statement show for the post_max_size setting? Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-927681 Share on other sites More sharing options...
esport Posted September 30, 2009 Author Share Posted September 30, 2009 Hi Thanks for your reply, I printed the post variable out, it prints the value out successfully, only until I have reached a certain point of lines of adding a new lines, the print_r statement returns blank. I have for example 10 form elements per line, with very little data in each that is being posted. When it reaches 30 lines (so you can say there are 300 form elements being posted), the last elements of the post don't seem to be received. I haven't yet determined to which point they are cut off. Im working on that now. My post_max_size is set to 8M. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928025 Share on other sites More sharing options...
esport Posted October 1, 2009 Author Share Posted October 1, 2009 It seems like it cuts off the last of the form elements that are being posted at a certain point. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928061 Share on other sites More sharing options...
PFMaBiSmAd Posted October 1, 2009 Share Posted October 1, 2009 If only a specific maximum number of form fields is passed, it is likely that the web server has the Suhosin Hardened-PHP patch applied. You need to talk to your web host about the limit and/or break up the data into separate pages. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928064 Share on other sites More sharing options...
esport Posted October 1, 2009 Author Share Posted October 1, 2009 Thanks heaps for your advice. I will get back to you and let you know how I go. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928116 Share on other sites More sharing options...
redarrow Posted October 1, 2009 Share Posted October 1, 2009 Can you post the whole page this is interesting mate? Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928279 Share on other sites More sharing options...
esport Posted October 1, 2009 Author Share Posted October 1, 2009 Hi, No I can only post a certain number of form elements/objects to the point the rest are ignored. So basically the form is not 100% completing the submission or when the data is being processed it only allows a certain number form objects. I haven't worked out to how many the server can accept before ignoring the rest of the data. It hit the point around 300 form objects being posted before I start noticing it. Weird gear huh?? I know its a lot of of form data being processed but I'm not aware if there is a limit. I have emailed the web server guys and still awaiting a response. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928760 Share on other sites More sharing options...
esport Posted October 2, 2009 Author Share Posted October 2, 2009 I have attached the php file to the post. not sure if it will help. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928850 Share on other sites More sharing options...
PFMaBiSmAd Posted October 2, 2009 Share Posted October 2, 2009 One check you can do for yourself is to create a .php script with a phpinfo(); statement, then browse to this script and search on the resulting page for any settings containing the word suhosin. The setting in question, if it is present and if it shows up in the phpinfo() output, would be suhosin.post.max_vars Edit: actually your .php code is only slightly helpful because we don't have access to all the parts necessary to test it, like your database, include files... What would be helpful though, assuming that the problem is in the form and not the server, is if you attached the html "view source" of a form page that doesn't work. That would let someone examine and/or test if it contains a valid form with all the 300+ fields correctly represented and if they do post correctly. Make sure you xxxxx out any sensitive information, but don't alter the html on the page. Quote Link to comment https://forums.phpfreaks.com/topic/176026-not-receiving-data-from-form-post/#findComment-928854 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.