i am a student who does not understand the while loop, my programming knowledge is very basic. I am trying to pull data from a .txt file and make the $numCopies add everything in the data sheet they should add up to 52 and the $numOrders should add up to 20. what am i doing wrong with this code, i am completely lost.
html code is
Software1SOFTWARE ORDERS: REPORT
php code is
<?php $totalCopies = $_POST['totalCopies']; $totalOrders = $_POST['totalOrders']; $nextOrder = $_POST['nextOrder']; $totalCopies = 0; $totalOrders = 0; $orderFile = fopen("ordersBoles.txt", "r"); $nextOrder = fgets ($orderFile); while ($totalCopies == 20 and $totalOrders == 20) { list($totalCopies, $totalOrders) = explode (":", $empRecord); $totalCopies = $totalCopies + $nextOrder; $totalOrder = $totalOrder + nextOrder; } fclose($orderFile); print ("SOFTWARE ORDERS: REPORT
"); print ("TOTAL COPIES ORDERED: $totalCopies
"); print ("TOTAL ORDERS: $totalOrders
"); ?>my .txt file is
1 Linux:1
2 Macintosh:1
3 Windows:1
4 Macintosh:1
5 Macintosh:2
6 Linux:5
7 Macintosh:10
8 Windows:10
9 Macintosh:1
10 Windows:1
11 Windows:1
12 Linux:1
13 Macintosh:5
14 Linux:4
15 Windows:1
16 Macintosh:1
17 Windows:1
18 Linux:2
19 Macintosh:2
20 Windows:1
21
i know my code is a mess but any help would be wonderful