All selected rows not submitted on form submit

A

Anonymous

Guest
I have an HTML table located within a form. The first column of the table is a checkbox. When the form is submitted, it opens a popup window and calls another php file to process the selected items in the table. However, it never sends more than 1000 items from the table and I don't know why. The initial code used a GET for the form submission, which I changed to a POST, but that did not help.

Here is the form definition
Code:
<form id="scanform" method="POST" action="launchscan.php" target="scan_window">

Here if the selection box that the user chooses to kick off the process that is failing to receive all the records
Code:
        <span style="float:right;">
                Select Scan on Selected Hosts:
                <select name="scan_type">
                        <option value="ttlsearch">Title Search</option>
                        <option value="ipscan">IP Scan</option>
                </select>
                <input type="button" onclick="launchscan()" value="Scan">
        </span>

Here is the table definition from which rows are selected
Code:
         <table id="home" width="100%" cellspacing="0" align="center" class="display">
                <thead>
                <tr>
                        <th><input type="checkbox" onClick="toggle(this)"/></th>
                        <th>IP</th>
                        <th>DNS</th>
                        <th>Port</th>
                </tr>
                </thead>
                <tbody>
                <tr class="item">
                <td><input type="checkbox" name="selected[]" value="111.111.111.111:443:abc.com"/></td>
                <td>111.111.111.111</td>
		<td>abc.com</td>
		<td>443</td>
		</tr>
               ...repeat...
</tbody>
</table>
</form>

Here is the JavaScript for the button call
Code:
function launchscan() {
        window.open('', 'scan_window',"height=400,width=600");
        var all = document.body.getElementsByTagName("*");
        document.getElementById('scanform').submit();
}

Here is the snippet of code from launchscan.php. This code processes the selected rows in the HTML table. If I select over 1000 rows it never sends more than 1000. I cannot determine why.
Code:
if(isset($_REQUEST['selected'])){
    foreach($_POST['selected'] as $selected){
        $split = explode(':', $selected);
        $line = $split[1] . "," . $split[2] . "," . $split[0] . "\n";
        fwrite($Handle,$line);
    }
    fclose($Handle);
    echo "Input File $filename written.<br>";
}
else{
    echo "not selected\n";
}

If anybody can give me some insight into this I would be appreciative. I am just getting back into php and this is a bit confounding.
TIA
 
My suggestion would to get the PHP to work first then add the JavaScript. HTML tables should only be used to display data like a spreadsheet does and that is the only time I would use a table. I think you need to revise your logic on that part. Just my .02 cents...
 
Everything is working. The only issue is that, if I select more than 1000 rows I do not receive the extra rows. This was pre-existing code. I am maintaining it, I am just trying to determine why it refuses to send over 1k selected rows. Initially, I thought it was because the form was using GET, so I changed it to POST, but that did not help.
 
The issue was that the
Code:
max_input_vars
was set to the default of 1000 in the php.ini file.
 
Back
Top