/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Failing to collect data from certain form-elements, may be ‘max elements reached’?

Hello fellow programmers,

I have a little but frustrating problem with one webpage which contain many form-elements.
The main thing is that specific data which is present at the end of the html-code is not collected by PHP-code.
Via google i came across [URL=”http://www.webdeveloper.com/forum/showthread.php?t=151794″]this topic[/URL] and checked the post-action in my code, did not have to change anything, all my forms have method ‘post’.

Before i explain the problem in detail first begin with a little scope:
I have a lot of rows of data (number of rows is dynamic) and this is exported to html in a table with many form-elements.
Every data-set (row) is connected with an id which is placed in a invisible input-element at the start of each row.

For example i have a datasheet of 10 rows.
I edit some input-fields of row1, row2 and row3… after submitting i see that everything is changed like it should.
Now i edit input-fields in row9 and row10… after submitting the changes are -not- applied.
I do this again and again for each row and i notice that [U]everything untill a certain field in the middle of row7 is saved correctly and the rest is not[/U].

What is interesting is that the field is somewhere in the middle of row7 i.s.o. it is seperated by a row, row1-6 OK, row7-10 NOK.
Now, when each row is created in html, it is just a loop using a template for each row, so it cant be an error in the phpcode (“generate html for output”-part) because if row8 is not working then row1,2,3 should also be incorrect.

Using firefox webdeveloper i now print every invisible element and show all form details.
I triple-checked that everything is in order… that is, every row has a id-value and the titles of all form-elements are correct.

So i go printing raw data in php-engine (“collect formdata”-part) and notice that the data collected from that specific field in row7 untill row10 is empty.

Every other field that is behind the table, so this is not related to data-table, is also empty.
So if i make a input-field with value “Testing” and place it next to the submit-button (which is below the data-table) and print the value in php its empty.

I’m thinking of some html-related thing but i do not know how to solve this or how to investigate the problem any further.

Can anyone help me with this one?
If more info is needed just ask.

Greetings, Belvedere.

to post a comment
HTML

19 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 01.2008 — I would not rely on [I]post[/I] allowing unlimited length data. Each browser has a different limit, although I doubt that this is the problem.

Are you dynamically adding elements? Incorrect creation, in IE, causes problems.

Also are the name/values correctly added with static and/or dynamic content?

Does the document validate?

Use [I]get [/I]to check if name/values are sent.

Do you use the [I]post[/I] array server side to retrieve all name/values?

A look at the document/link could be useful.
Copy linkTweet thisAlerts:
@BelvedereauthorJun 01.2008 — Thanx for replying.

[i]Are you dynamically adding elements? Incorrect creation, in IE, causes problems.[/i]

No, the data-table is generated in PHP and then exported once, using template(s), to HTML.

I'm not creating new form-elements after that point.

[i]Also are the name/values correctly added with static and/or dynamic content?[/i]

Yes i believe so, i checked them more than once. Below more...

[i]Does the document validate?[/i]

Yes both CSS, Javascript and PHP return no errors or warnings.

[i]Use 'get' to check if name/values are sent.[/i]

Not sure what you mean by that...

I use GET once to tell the PHP it should update the database, like link.php?m=submit, and that goes ok.

[i]Do you use the 'post' array server side to retrieve all name/values?[/i]

Yes.

[i]A look at the document/link could be useful.[/i]

I cant give you a link but here's a piece of the code:

[CODE]<form name='editdb_a' action='admin.php?c=51&tid=ws04&m=submit1' method='post' onsubmit='return validate_input1();'>
...
<td><input type='text' name='dbedit_id1' value='41' style='display:none;'/><img src='no.gif' width='1' height='2' /><br/>41</td>
<td><input type='text' name='dbedit_searchfor1' value='**************' size='30'/><input type='text' name='dbedit_searchfor1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_afterbase1' value='**************' size='8'/><input type='text' name='dbedit_afterbase1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_length1' value='**************' size='4'/><input type='text' name='dbedit_length1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_unit1' value='**************' size='6'/><input type='text' name='dbedit_unit1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_down1' value='**************' size='9'/><input type='text' name='dbedit_down1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_up1' value='**************' size='9'/><input type='text' name='dbedit_up1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_special1' value='**************' size='12'/><input type='text' name='dbedit_special1_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_tagg1' value='**************' size='8'/><input type='text' name='dbedit_tagg1_bak' value='**************' style='display:none;'/></td>
...
<td><input type='text' name='dbedit_id2' value='42' style='display:none;'/><img src='no.gif' width='1' height='2' /><br/>42</td>
<td><input type='text' name='dbedit_searchfor2' value='**************' size='30'/><input type='text' name='dbedit_searchfor2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_afterbase2' value='**************' size='8'/><input type='text' name='dbedit_afterbase2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_length2' value='**************' size='4'/><input type='text' name='dbedit_length2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_unit2' value='**************' size='6'/><input type='text' name='dbedit_unit2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_down2' value='**************' size='9'/><input type='text' name='dbedit_down2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_up2' value='**************' size='9'/><input type='text' name='dbedit_up2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_special2' value='**************' size='12'/><input type='text' name='dbedit_special2_bak' value='**************' style='display:none;'/></td>
<td><input type='text' name='dbedit_tagg2' value='**************' size='8'/><input type='text' name='dbedit_tagg2_bak' value='**************' style='display:none;'/></td>
...

etc. etc. etc. (above only shows 2 rows)

...
<input type='submit' id='submit1' value='Submit' class='button' /><input type='text' name='dbedit_id22' value='end' style='display:none;'/>
</form>[/CODE]

In above the fields increase with a number... so if i want to collect the searchfor-value of row 3 i do this with 'dbedit_searchfor[b]3[/b]'.

Below is a part of the PHP-code:

[CODE]$i = 1;
$whileloop = 1;
while ($whileloop==1)
{
$dbedit_id = cv('dbedit_id'.$i,'P','TXT');
$dbedit_searchfor = cv('dbedit_searchfor'.$i,'P','TXT'); $dbedit_searchfor_bak = cv('dbedit_searchfor'.$i.'_bak','P','TXT');
$dbedit_afterbase = cv('dbedit_afterbase'.$i,'P','TXT'); $dbedit_afterbase_bak = cv('dbedit_afterbase'.$i.'_bak','P','TXT');
$dbedit_length = cv('dbedit_length'.$i,'P','TXT'); $dbedit_length_bak = cv('dbedit_length'.$i.'_bak','P','TXT');
$dbedit_unit = cv('dbedit_unit'.$i,'P','TXT'); $dbedit_unit_bak = cv('dbedit_unit'.$i.'_bak','P','TXT');
$dbedit_down = cv('dbedit_down'.$i,'P','TXT'); $dbedit_down_bak = cv('dbedit_down'.$i.'_bak','P','TXT');
$dbedit_up = cv('dbedit_up'.$i,'P','TXT'); $dbedit_up_bak = cv('dbedit_up'.$i.'_bak','P','TXT');
$dbedit_special = cv('dbedit_special'.$i,'P','TXT'); $dbedit_special_bak = cv('dbedit_special'.$i.'_bak','P','TXT');
$dbedit_tagg = cv('dbedit_tagg'.$i,'P','TXT'); $dbedit_tagg_bak = cv('dbedit_tagg'.$i.'_bak','P','TXT');

print("- dbedit_id".$i." - ".$dbedit_id."<br/>");

// stop the loop when this end-info is collected instead of an number
if ($dbedit_id=='end') { $whileloop = 0; }
else
{
// determine if there is a change
$dbchange = "";
if ($dbedit_searchfor!=$dbedit_searchfor_bak) { $dbchange = "spec_searchfor='".$dbedit_searchfor."'"; }
if ($dbedit_afterbase!=$dbedit_afterbase_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_afterbase='".$dbedit_afterbase."'" : "spec_afterbase='".$dbedit_afterbase."'"; }
if ($dbedit_length!=$dbedit_length_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_length='".$dbedit_length."'" : "spec_length='".$dbedit_length."'"; }
if ($dbedit_unit!=$dbedit_unit_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_unitname='".$dbedit_unit."'" : "spec_unitname='".$dbedit_unit."'"; }
if ($dbedit_down!=$dbedit_down_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_down='".$dbedit_down."'" : "spec_down='".$dbedit_down."'"; }
if ($dbedit_up!=$dbedit_up_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_up='".$dbedit_up."'" : "spec_up='".$dbedit_up."'"; }
if ($dbedit_special!=$dbedit_special_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_special='".$dbedit_special."'" : "spec_special='".$dbedit_special."'"; }
if ($dbedit_tagg!=$dbedit_tagg_bak) { $dbchange .= (!empty($dbchange)) ? ", spec_tagg='".$dbedit_tagg."'" : "spec_tagg='".$dbedit_tagg."'"; }

// if a change is present update database
if (!empty($dbchange)) { $sql = sys_query("UPDATE ".$db_database." SET ".$dbchange." WHERE database_id='".$dbedit_id."'"); }
}
$i++;
}[/CODE]

The function cv() collects the data using GET or POST.

The 'P' means POST and the 'TXT' means any char is allowed.

I hope this info helps!

EDIT:

If i print the value in $dbedit_id right after it has been collected with...

print("dbedit_id".$i." = '".$dbedit_id."'<br/>");

... the following output is generated:

dbedit_id1 = '41'

dbedit_id2 = '42'

dbedit_id3 = '43'

dbedit_id4 = '44'

dbedit_id5 = '45'

dbedit_id6 = '46'

dbedit_id7 = '47'

dbedit_id8 = '48'

dbedit_id9 = '49'

dbedit_id10 = '50'

dbedit_id11 = '51'

dbedit_id12 = '52'

dbedit_id13 = ''

dbedit_id14 = ''

dbedit_id15 = ''

dbedit_id16 = ''

dbedit_id17 = ''

dbedit_id18 = ''

dbedit_id19 = ''

dbedit_id20 = ''

dbedit_id21 = ''

dbedit_id22 = ''

dbedit_id23 = ''

dbedit_id24 = ''

dbedit_id25 = ''

...
Copy linkTweet thisAlerts:
@NogDogJun 01.2008 — ...[i]Does the document validate?[/i]

Yes both CSS, Javascript and PHP return no errors or warnings....
[/QUOTE]

How about the [url=http://validator.w3.org/]HTML validation[/url]? (This would likely be the most important aspect to this problem if it's an invalid mark-up issue.)
Copy linkTweet thisAlerts:
@BelvedereauthorJun 01.2008 — Thanx NogDog for that tip... the page indeed contains some errors, total 16.

Most are simple like alt missing but some need looked at.

I'm going to remove these untill validation is correct and report back.
Copy linkTweet thisAlerts:
@BelvedereauthorJun 01.2008 — I decided to sweep through the complete site and remove all errors, especially within the admin.php part where above problem is located.

Now when i view and copy the source in W3C validation (settings: utf-8, XHTML 1.0 Transitional) is shows the green bar with:

"This Page Is Valid XHTML 1.0 Transitional!"

But unfortunately the problem still exist without any changes... ?
Copy linkTweet thisAlerts:
@FangJun 02.2008 — Use 'get' to check if name/values are sent.

Not sure what you mean by that...

I use GET once to tell the PHP it should update the database, like link.php?m=submit, and that goes ok.[/QUOTE]

Change the method to [I]get[/I] and the action to a simple html page so that the form is not processed.

Copy the contents of the address bar to an editor to see if the name/value pairs are all sent correctly.

I could not see from the snippet if the form tags were outside the table. A source of problems if this is not so.

Change the inputs with [I]style='display:none;'[/I] to [I]type='hidden'[/I]

Use of [I]style='display:none;'[/I] is not guaranteed to be successful.
Copy linkTweet thisAlerts:
@BelvedereauthorJun 02.2008 — [i]I could not see from the snippet if the form tags were outside the table. A source of problems if this is not so.[/i]

The form is started <form ...> before the table is created <table ...> and just after closing the table </table> i close the form </form>.

So the form is holding the complete table.

[i]Change the inputs with style='display:none;' to type='hidden'[/i]

Done this for every input-field present in that specific page... will soon submit this for every invisible 'display:none'-field on the site.

I cannot do the 'hidden type'-trick for three invisible textarea's on that specific page, any hints or is this not relevant for textarea's?

[i]Change the method to get and the action to a simple html page so that the form is not processed. Copy the contents of the address bar to an editor to see if the name/value pairs are all sent correctly.[/i]

Done this but when the output is exported to the link i see that the amount of info is too much for the function to handle...

I made all fields empty so as much data as possible is printed, i get the following output (edited in texteditor to make it clean):
[CODE]http://www.host.com/admin.php?
dbedit_testid=data&
dbedit_id1=41&
dbedit_searchfor1=&
dbedit_searchfor1_bak=&
dbedit_afterbase1=&
dbedit_afterbase1_bak=&
dbedit_length1=&
dbedit_length1_bak=&
dbedit_unit1=&
dbedit_unit1_bak=&
dbedit_down1=&
dbedit_down1_bak=&
dbedit_up1=&
dbedit_up1_bak=&
dbedit_special1=&
dbedit_special1_bak=&
dbedit_tagg1=&
dbedit_tagg1_bak=&
dbedit_id2=42&
dbedit_searchfor2=&
dbedit_searchfor2_bak=&
dbedit_afterbase2=&
dbedit_afterbase2_bak=&
dbedit_length2=&
dbedit_length2_bak=&
dbedit_unit2=&
dbedit_unit2_bak=&
dbedit_down2=&
dbedit_down2_bak=&
dbedit_up2=&
dbedit_up2_bak=&
dbedit_special2=&
dbedit_special2_bak=&
dbedit_tagg2=&
dbedit_tagg2_bak=&
dbedit_id3=43&
dbedit_searchfor3=&
dbedit_searchfor3_bak=&
dbedit_afterbase3=&
dbedit_afterbase3_bak=&
dbedit_length3=&
dbedit_length3_bak=&
dbedit_unit3=&
dbedit_unit3_bak=&
dbedit_down3=&
dbedit_down3_bak=&
dbedit_up3=&
dbedit_up3_bak=&
dbedit_special3=&
dbedit_special3_bak=&
dbedit_tagg3=&
dbedit_tagg3_bak=&
dbedit_id4=44&
dbedit_searchfor4=&
dbedit_searchfor4_bak=&
dbedit_afterbase4=&
dbedit_afterbase4_bak=&
dbedit_length4=&
dbedit_length4_bak=&
dbedit_unit4=&
dbedit_unit4_bak=&
dbedit_down4=&
dbedit_down4_bak=&
dbedit_up4=&
dbedit_up4_bak=&
dbedit_special4=&
dbedit_special4_bak=&
dbedit_tagg4=&
dbedit_tagg4_bak=&
dbedit_id5=45&
dbedit_searchfor5=&
dbedit_searchfor5_bak=&
dbedit_afterbase5=&
dbedit_afterbase5_bak=&
dbedit_length5=&
dbedit_length5_bak=&
dbedit_unit5=&
dbedit_unit5_bak=&
dbedit_down5=&
dbedit_down5_bak=&
dbedit_up5=&
dbedit_up5_bak=&
dbedit_special5=&
dbedit_special5_bak=&
dbedit_tagg5=&
dbedit_tagg5_bak=&
dbedit_id6=46&
dbedit_searchfor6=&
dbedit_searchfor6_bak=&
dbedit_afterbase6=&
dbedit_afterbase6_bak=&
dbedit_length6=&
dbedit_length6_bak=&
dbedit_unit6=&
dbedit_unit6_bak=&
dbedit_down6=&
dbedit_down6_bak=&
dbedit_up6=&
dbedit_up6_bak=&
dbedit_special6=&
dbedit_special6_bak=&
dbedit_tagg6=&
dbedit_tagg6_bak=&
dbedit_id7=47&
dbedit_searchfor7=&
dbedit_searchfor7_bak=&
dbedit_afterbase7=&
dbedit_afterbase7_bak=&
dbedit_length7=&
dbedit_length7_bak=&
dbedit_unit7=&
dbedit_unit7_bak=&
dbedit_down7=&
dbedit_down7_bak=&
dbedit_up7=&
dbedit_[/CODE]

This could be it,... but as you can see in my previous post, the data is cut off at "dbedit_id13" i.s.o. "dbedit_id7".

Any way to get this get-form investigation trick to work without cutting off at "dbedit_up7" ???
Copy linkTweet thisAlerts:
@BelvedereauthorJun 02.2008 — I changed the titles of the fields into shorter names:

edit "dbedit_*" to "*"

edit "*_
bak" to "*B"

And then i did the same trick, now the output is as follows:
[CODE]http://www.host.com/admin.php?
testid=data&
id1=41&
searchfor1=&
searchfor1B=&
afterbase1=&
afterbase1B=&
length1=&
length1B=&
unit1=&
unit1B=&
down1=&
down1B=&
up1=&
up1B=&
special1=&
special1B=&
tagg1=&
tagg1B=&
id2=42&
searchfor2=&
searchfor2B=&
afterbase2=&
afterbase2B=&
length2=&
length2B=&
unit2=&
unit2B=&
down2=&
down2B=&
up2=&
up2B=&
special2=&
special2B=&
tagg2=&
tagg2B=&
id3=43&
searchfor3=&
searchfor3B=&
afterbase3=&
afterbase3B=&
length3=&
length3B=&
unit3=&
unit3B=&
down3=&
down3B=&
up3=&
up3B=&
special3=&
special3B=&
tagg3=&
tagg3B=&
id4=44&
searchfor4=&
searchfor4B=&
afterbase4=&
afterbase4B=&
length4=&
length4B=&
unit4=&
unit4B=&
down4=&
down4B=&
up4=&
up4B=&
special4=&
special4B=&
tagg4=&
tagg4B=&
id5=45&
searchfor5=&
searchfor5B=&
afterbase5=&
afterbase5B=&
length5=&
length5B=&
unit5=&
unit5B=&
down5=&
down5B=&
up5=&
up5B=&
special5=&
special5B=&
tagg5=&
tagg5B=&
id6=46&
searchfor6=&
searchfor6B=&
afterbase6=&
afterbase6B=&
length6=&
length6B=&
unit6=&
unit6B=&
down6=&
down6B=&
up6=&
up6B=&
special6=&
special6B=&
tagg6=&
tagg6B=&
id7=47&
searchfor7=&
searchfor7B=&
afterbase7=&
afterbase7B=&
length7=&
length7B=&
unit7=&
unit7B=&
down7=&
down7B=&
up7=&
up7B=&
special7=&
special7B=&
tagg7=&
tagg7B=&
id8=48&
searchfor8=&
searchfor8B=&
afterbase8=&
afterbase8B=&
length8=&
length8B=&
unit8=&
unit8B=&
down8=&
down8B=&
up8=&
up8B=&
special8=&
special8B=&
tagg8=&
tagg8B=&
id9=49&
searchfor9=&
searchfor9B=&
afterbase9=&
afterbase9B=&
length9=&
length9B=&
unit9=&
unit9B=&
down9=&
down9B=&
up9=&
up9B=&
special9=&
special9B=&
tagg9=&
tagg9B=&
id10=50&
searchfor10=&
searchfor10B=&
afterbase10=&
afterbase10B=&
length10=&
length10B=&
unit10=&
unit10B=&
down10=&
down10B=&
up10=&
up10B=&
special10=&
special10B=&
tagg10=&
tagg10B=&
id11=51&
searchfor11=&
searchfor11B=&
afterbase11=&
afterbase11B=&
length11=&
length11B=&
unit11=&
unit11B=&
down11=&
down11B=&
up11=&
up11B=&
special11=&
special11B=&
tagg11=&
tagg11B=&
id12=52&
searchfor12=&
searchfor12B=&
afterbase12=&
afterbase12B=&
length12=&
length12B=&
unit12=&
unit12B=&
down12=2&
down12B=2&
up12=3&
up12B=3&
special12=&
special12B=&
tagg12=&
tagg12B=&
id13=53&
searchfor13=&
searchfor13B=&
afterbase13=&
afterbase13B=&
length13=&
length13B=&
unit13=&
unit13B=&
down13=&
d[/CODE]

The data is still cut off but now we can see the "id13=53" part at the bottom.

So the data in field id13 -is- collected by GET.

But after synchronising shorter fieldnames in PHP-code and doing form action post again... in PHP it is still empty (just like in my second topicpost):

id1 = '41'

id2 = '42'

id3 = '43'

id4 = '44'

id5 = '45'

id6 = '46'

id7 = '47'

id8 = '48'

id9 = '49'

id10 = '50'

id11 = '51'

id12 = '52'

id13 = ''

id14 = ''

id15 = ''

id16 = ''

...
Copy linkTweet thisAlerts:
@FangJun 02.2008 — I cannot do the 'hidden type'-trick for three invisible textarea's on that specific page, any hints or is this not relevant for textarea's?[/QUOTE]Change the display value of the textareas after the document loads. That way the textareas are added to the DOM.

I've made a form generator.

FF can only send 8KB (server limit) and IE 2KB using GET.

POST has a huge limit in comparison.

Do you get the same cut-off point using your script with both browsers?

Is there nothing unusual in the source of the document around the cut-off point?
Copy linkTweet thisAlerts:
@BelvedereauthorJun 02.2008 — [i]Change the display value of the textareas after the document loads. That way the textareas are added to the DOM.[/i]

Will try to fabricate sumthing like that right now...

[i]Do you get the same cut-off point using your script with both browsers?[/i]

Nope... indeed the GET-limit of FF is higher, following GET-output is from FF:
[CODE]http://www.host.com/admin.php?
testid=data&
id1=41&
searchfor1=&
searchfor1B=&
afterbase1=&
afterbase1B=&
length1=&
length1B=&
unit1=&
unit1B=&
down1=&
down1B=&
up1=&
up1B=&
special1=&
special1B=&
tagg1=&
tagg1B=&
id2=42&
searchfor2=&
searchfor2B=&
afterbase2=&
afterbase2B=&
length2=&
length2B=&
unit2=&
unit2B=&
down2=&
down2B=&
up2=&
up2B=&
special2=&
special2B=&
tagg2=&
tagg2B=&
id3=43&
searchfor3=&
searchfor3B=&
afterbase3=&
afterbase3B=&
length3=&
length3B=&
unit3=&
unit3B=&
down3=&
down3B=&
up3=&
up3B=&
special3=&
special3B=&
tagg3=&
tagg3B=&
id4=44&
searchfor4=&
searchfor4B=&
afterbase4=&
afterbase4B=&
length4=&
length4B=&
unit4=&
unit4B=&
down4=&
down4B=&
up4=&
up4B=&
special4=&
special4B=&
tagg4=&
tagg4B=&
id5=45&
searchfor5=&
searchfor5B=&
afterbase5=&
afterbase5B=&
length5=&
length5B=&
unit5=&
unit5B=&
down5=&
down5B=&
up5=&
up5B=&
special5=&
special5B=&
tagg5=&
tagg5B=&
id6=46&
searchfor6=&
searchfor6B=&
afterbase6=&
afterbase6B=&
length6=&
length6B=&
unit6=&
unit6B=&
down6=&
down6B=&
up6=&
up6B=&
special6=&
special6B=&
tagg6=&
tagg6B=&
id7=47&
searchfor7=&
searchfor7B=&
afterbase7=&
afterbase7B=&
length7=&
length7B=&
unit7=&
unit7B=&
down7=&
down7B=&
up7=&
up7B=&
special7=&
special7B=&
tagg7=&
tagg7B=&
id8=48&
searchfor8=&
searchfor8B=&
afterbase8=&
afterbase8B=&
length8=&
length8B=&
unit8=&
unit8B=&
down8=&
down8B=&
up8=&
up8B=&
special8=&
special8B=&
tagg8=&
tagg8B=&
id9=49&
searchfor9=&
searchfor9B=&
afterbase9=&
afterbase9B=&
length9=&
length9B=&
unit9=&
unit9B=&
down9=&
down9B=&
up9=&
up9B=&
special9=&
special9B=&
tagg9=&
tagg9B=&
id10=50&
searchfor10=&
searchfor10B=&
afterbase10=&
afterbase10B=&
length10=&
length10B=&
unit10=&
unit10B=&
down10=&
down10B=&
up10=&
up10B=&
special10=&
special10B=&
tagg10=&
tagg10B=&
id11=51&
searchfor11=&
searchfor11B=&
afterbase11=&
afterbase11B=&
length11=&
length11B=&
unit11=&
unit11B=&
down11=&
down11B=&
up11=&
up11B=&
special11=&
special11B=&
tagg11=&
tagg11B=&
id12=52&
searchfor12=&
searchfor12B=&
afterbase12=&
afterbase12B=&
length12=&
length12B=&
unit12=&
unit12B=&
down12=&
down12B=&
up12=&
up12B=&
special12=&
special12B=&
tagg12=&
tagg12B=&
id13=53&
searchfor13=&
searchfor13B=&
afterbase13=&
afterbase13B=&
length13=&
length13B=&
unit13=&
unit13B=&
down13=&
down13B=&
up13=&
up13B=&
special13=&
special13B=&
tagg13=&
tagg13B=&
id14=54&
searchfor14=&
searchfor14B=&
afterbase14=&
afterbase14B=&
length14=&
length14B=&
unit14=&
unit14B=&
down14=&
down14B=&
up14=&
up14B=&
special14=&
special14B=&
tagg14=&
tagg14B=&
id15=55&
searchfor15=&
searchfor15B=&
afterbase15=&
afterbase15B=&
length15=&
length15B=&
unit15=&
unit15B=&
down15=&
down15B=&
up15=&
up15B=&
special15=&
special15B=&
tagg15=&
tagg15B=&
id16=56&
searchfor16=&
searchfor16B=&
afterbase16=&
afterbase16B=&
length16=&
length16B=&
unit16=&
unit16B=&
down16=&
down16B=&
up16=&
up16B=&
special16=&
special16B=&
tagg16=&
tagg16B=&
id17=57&
searchfor17=&
searchfor17B=&
afterbase17=&
afterbase17B=&
length17=&
length17B=&
unit17=&
unit17B=&
down17=&
down17B=&
up17=&
up17B=&
special17=&
special17B=&
tagg17=&
tagg17B=&
id18=58&
searchfor18=&
searchfor18B=&
afterbase18=&
afterbase18B=&
length18=&
length18B=&
unit18=&
unit18B=&
down18=&
down18B=&
up18=&
up18B=&
special18=&
special18B=&
tagg18=&
tagg18B=&
id19=59&
searchfor19=&
searchfor19B=&
afterbase19=&
afterbase19B=&
length19=&
length19B=&
unit19=&
unit19B=&
down19=&
down19B=&
up19=&
up19B=&
special19=&
special19B=&
tagg19=&
tagg19B=&
id20=60&
searchfor20=&
searchfor20B=&
afterbase20=&
afterbase20B=&
length20=&
length20B=&
unit20=&
unit20B=&
down20=&
down20B=&
up20=&
up20B=&
special20=&
special20B=&
tagg20=&
tagg20B=&
id21=61&
searchfor21=&
searchfor21B=&
afterbase21=&
afterbase21B=&
length21=&
length21B=&
unit21=&
unit21B=&
down21=&
down21B=&
up21=&
up21B=&
special21=&
special21B=&
tagg21=&
tagg21B=&
dbedit_id22=end[/CODE]

Now the "end"-data is also present at the bottom, which should stop the while-loop in PHP.

Data is not cut short.

[i]Is there nothing unusual in the source of the document around the cut-off point?[/i]

As i can tell no there isnt, but you can judge for yourself.

Following is source-code of row12 and row13 (all upto 'up12' is present in PHP, 'up12B' and all following is not present in PHP):
[CODE]...
<tr>
<td><input type='hidden' name='id12' value='52'/><img src='no.gif' width='1' height='2' alt=''/><br/>52</td>
<td><input type='text' name='searchfor12' value='' size='30'/><input type='hidden' name='searchfor12B' value=''/></td>
<td><input type='text' name='afterbase12' value='' size='8'/><input type='hidden' name='afterbase12B' value=''/></td>
<td><input type='text' name='length12' value='' size='4'/><input type='hidden' name='length12B' value=''/></td>
<td><input type='text' name='unit12' value='' size='6'/><input type='hidden' name='unit12B' value=''/></td>
<td><input type='text' name='down12' value='2' size='9'/><input type='hidden' name='down12B' value='2'/></td>
<td><input type='text' name='up12' value='3' size='9'/><input type='hidden' name='up12B' value='3'/></td>
<td><input type='text' name='special12' value='' size='12'/><input type='hidden' name='special12B' value=''/></td>
<td><input type='text' name='tagg12' value='' size='8'/><input type='hidden' name='tagg12B' value=''/></td>
<td style='text-align:center;'><img src='no.gif' width='1' height='2' alt=''/><br/><span style='font-size:9px;' onclick='deleteitem(52);'>x</span></td>

</tr>
<tr>
<td><input type='hidden' name='id13' value='53'/><img src='no.gif' width='1' height='2' alt=''/><br/>53</td>
<td><input type='text' name='searchfor13' value='' size='30'/><input type='hidden' name='searchfor13B' value=''/></td>
<td><input type='text' name='afterbase13' value='' size='8'/><input type='hidden' name='afterbase13B' value=''/></td>
<td><input type='text' name='length13' value='' size='4'/><input type='hidden' name='length13B' value=''/></td>
<td><input type='text' name='unit13' value='' size='6'/><input type='hidden' name='unit13B' value=''/></td>
<td><input type='text' name='down13' value='' size='9'/><input type='hidden' name='down13B' value=''/></td>
<td><input type='text' name='up13' value='' size='9'/><input type='hidden' name='up13B' value=''/></td>
<td><input type='text' name='special13' value='' size='12'/><input type='hidden' name='special13B' value=''/></td>
<td><input type='text' name='tagg13' value='' size='8'/><input type='hidden' name='tagg13B' value=''/></td>
<td style='text-align:center;'><img src='no.gif' width='1' height='2' alt=''/><br/><span style='font-size:9px;' onclick='deleteitem(53);'>x</span></td>
</tr>
...[/CODE]

btw: Thanx again for helping!!
Copy linkTweet thisAlerts:
@FangJun 02.2008 — Can you test the form (post version) on a different server and with both browsers?

Check the [I]post_max_size[/I] in php.ini
Copy linkTweet thisAlerts:
@BelvedereauthorJun 02.2008 — I cannot test the code on the different server right now, but i can within 2 weeks when the site should go live on a different server.

Looking for php.ini on my own server, i found something interesting...

In a dir titled 'logs' (which is situated next to HTML-dir, close to root) i found a file named 'error_log' which is full, especially the tail, of the following:

[Mon Jun 02 18:23:22 2008] [error] [client **my ip**] ALERT - configured POST variable limit exceeded - dropped variable 'up12B' (attacker '**my ip**', file 'dir/dir/dir/admin.php'), referer: http://www.host.com/admin.php

Maybe this is making things more clear ??
Copy linkTweet thisAlerts:
@FangJun 02.2008 — Run <?php phpinfo(); ?>

Check the [I]post_max_size[/I]
Copy linkTweet thisAlerts:
@BelvedereauthorJun 02.2008 — local and master value: 64M
Copy linkTweet thisAlerts:
@FangJun 03.2008 — Try this generator with a large number of iputs, see if you get a cut-off point:
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;max length form&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;script type="text/javascript"&gt;
function addInput(idx) {
// fix for IE to add name attribute
var o;
try { //IE method
o = document.createElement('&lt;input type="text" name="text'+idx+'"&gt;');
}
catch (error) { // DOM method
o = document.createElement("input");
o.setAttribute('type', 'text');
o.setAttribute('name', 'text'+idx);
}
o.setAttribute('value', 'foo'+idx);
document.getElementById('controls').appendChild(o);
}

function addMore() {
var count=document.getElementById('controls').getElementsByTagName('input').length;
//alert(count)
for(var i=count; i&lt;(count+50); i++) {
addInput(i);
}
document.getElementById('counter').firstChild.data=count+50;
}
&lt;/script&gt;

&lt;style type="text/css"&gt;

&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;inputs: &lt;span id="counter"&gt;0&lt;/span&gt;&lt;/p&gt;
&lt;form action="postCheck.php" method="post" name="form1"&gt;
&lt;fieldset id="controls"&gt;
&lt;button type="button" onclick="addMore();"&gt;add more&lt;/button&gt;
&lt;button type="submit"&gt;submit&lt;/button&gt;
&lt;/fieldset&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

postCheck.php&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;postCheck&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;?php
foreach ( $_POST as $key =&gt; $value ) {
print $key . " = " . $value . "&lt;br&gt;";
echo "&lt;pre&gt;"; print_r( $value ); echo "&lt;/pre&gt;";
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@BelvedereauthorJun 03.2008 — The data is cut-off at 199... so that value is still printing in PHP... even if i do untill 500 or more in the html-script.

I tried both IE and FF.
Copy linkTweet thisAlerts:
@FangJun 03.2008 — I had no problem passing 1000+ entries.

I would suspect the server is the source of the problem.
Copy linkTweet thisAlerts:
@BelvedereauthorJun 03.2008 — Ok im going to contact the admin and link this topic.

Thanx VERY much for your help!!!

I report back soon.
Copy linkTweet thisAlerts:
@BelvedereauthorJun 18.2008 — I contacted the admin of the server and explained the problem.

They replied to me that they had made -a- change and i should check if the problem was solved.

Turns out 500 items are now transfered, instead of 200.

So it was server-side!!

Now i need to continue spamming in order to get that value to 2000+ items, bummer...

Thanx everyone (Fang) for helping me out.

Cheers.

edit: dunno how to get that RESOLVED thingy working.
×

Success!

Help @Belvedere spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...