So I’ve got a search form on which web based users enter their search requests, and it returns the resulting matching records in a standard HTML table, your basic rows & columns, with the lefthand column being a checkbox input rather than a field: a place for the user to check off SOME of the matching records and then submit (POST) the form to indicate that these are the wanted records. Think “shopping cart”.
The php code by which I’ve got the checkbox generated is like so:
echo ‘<td><input type=’ . $Qmk . ‘checkbox’ . $Qmk . ‘name=’ . $Qmk . ‘select’. $Qmk . ‘value=’ . $Qmk . $PrimaryKey. $Qmk . ‘/></td>’;
The form action submits the posted info to a results php page, on which the various values & parameters are snagged and stuffed into php $variables like so:
ownername = _POST[‘ownername’];
… but the line where I intend to snag the composite set of primary key values that were checked off is not returning the desired array of values:
primarykey = _POST[‘select’];
that version returns the bottom-most of multiple items checked off;
primarykey = array (_POST[‘select’]);
… so does that one.
What’s the easiest way to tell PhpDocument2.php that values 3, 5, and 8 were selected from an array of values returned from the database on PhpDocument1.php ?
All the PhpForDummies and PhpMadeEasy type stuff I’m flipping through gives good examples on how to do this if you have a hardwired set of checkable values, i.e., instead of row 3, row 6 and row 7 of records whose values cannot be known in advance, the examples assume everyone is selecting from among the same starting possibilities.