- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
Bollard
Sorry for the never ending flow of questions, but I have another question, that i was looking for some help for regarding a search stock page that i have been building:
As you can see from the code below, the search query outputs a table. The user first checks a row corresponding to an item they want (the RFQ column) and then one of the columns (called Quantity), in where the user can enter a quantity of the product they want. They then click a button and a request for quotation will be sent to the company (at the moment im just trying to echo out the selections made).
The query and output:
Which is then displayed:
// Check if parts have been selected for quotation already if (isset($_POST['SendRFQ'])) { $RFQ = $_POST['RFQ']; $Quantity=$_POST['Quantity']; $NumberRFQ = count($RFQ); // List parts selected for quotation if ($NumberRFQ>0) { echo 'RFQs chosen: '.$NumberRFQ.'<br /><br />'; echo 'You chose the following:<br /<br />'; echo '<table border="1" align="center">'; echo '<tr><th>Part Number</th>'; echo "<th>Quantity?</th></tr>"; for ($i=0; $i<$NumberRFQ; $i++) { echo '<tr>'; echo '<td>' . $RFQ[$i] . '</td>'; echo '<td>' . $Quantity[$i] . '</td>'; echo '</tr>'; } echo "</table>"; echo '<br /><br />'; } else { echo 'No parts have been chosen for quotation<br /><br />'; echo '<a href="/search.php">Click</a> to go back<br /><br />'; } }
Which kinda works.
If i select say, the first three rows sequentially, the quantities are displayed correctly.
But say i select rows 1, 3 and 5 (and enter quantities as 1, 3 and 5 respectively), then row 1 shows quantity 1, row 2 shows nothing and row 3 shows quantity 3?!
I understand it is becuase the RFQ[] array only contains the checked part numbers, where as the Quantity[] array contains all the cells contents, so the $i dont match - but i have no idea how to correct this?
Any ideas?
Cheers
Link to comment
https://www.neowin.net/forum/topic/909526-php-posting-values-from-a-table-with-checkboxes/Share on other sites
20 answers to this question
Recommended Posts