Jump to content

not receiving data from form post


esport

Recommended Posts

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.