PHP - Message is lost after 70th variable in array
Ok, I took the time to try and figure this out. I have a while loop that takes lines from the database and echos the input for each s selected_id[]
for names. When submitting, I use $ _REQUEST to collect the selected checkboxes, but for some reason, none of the inputs after the 70th variable will be posted. selected_id[0]
through selected_id[70]
will be published as normal, but selected_id[71]
above will not be.
Why can I only $ _REQUEST array up to the 70th variable in this array?
If I delete one of the records from the database, the problem still occurs when the 71st position is called again, or selected_id[70]
I am using PHP version 5.3.15 and my max_input_vars is 1000. my max_input_nesting_level is set to 64, but I don't think this is causing the problem. My memory_limit is set to 20M.
Here is my code:
<?php
if(!empty($_REQUEST[assignedprocess])){
$selected_id = $_REQUEST[selected_id];
$howmany = count($selected_id);
$msgback="(".$howmany.") Entry(ies) updated. <br>";
echo $msgback;
}
?>
<form action="index.php" method="post" name="index">
<?php
while($row = mysql_fetch_array($result_groups)){
echo "<input name="selected_id[]" type="checkbox" value="'.$row[id].'" />";
}
?>
<input type="hidden" name="assignedprocess" value="11">
<input type="submit" name="subs" value="Apply">
</form>
Sorry for my sloppy code and awful english ... I really appreciate any help you can give, thanks in advance.
source to share
Set php_value post_max_size to 15M (or more) in php.ini:
php_value post_max_size 15M
Fix code: (You miss the echo function)
<form action="index.php" method="post" name="index">
<?php
while($row = mysql_fetch_array($result_groups)){
$id= $row[id];
echo "<input name='selected_id[]' type='checkbox' value= $id />";
}
?>
<input type="hidden" name="assignedprocess" value="11">
<input type="submit" name="subs" value="Apply">
</form>
source to share