trying to create a simpleprogram that will read a text file and output information and calculations using the data in the text file. I have 4 radio buttons which represent an item Number. when one is selected the output form should print to a table the ID,Part,Count, Price, and the inventory Value ($count * $price), can anyone tell me what i am doing wrong?
This is what the .txt file looks like:
AC1000:Hammers:122:12.50
AC1001:Wrenches:5:5.00
AC1002:Handsaws:10:10.00
AC1003:Screwdrivers:222:3.00
Here's what i have so far:
<?php
$inf = 'infile.txt';
$FILEH = fopen($inf, 'r') or die ("Cannot open $inf");
$inline = fgets($FILEH,4096);
$found = 0;
$ptno =
//if (isset($_POST['AC1000']) || isset($_POST['AC1000']) || isset($_POST['AC1000']) || isset($_POST['AC1000'])) {
while (!feof($FILEH) && !($found)){
list($ptno,$ptname,$num,$price) = split (':', $inline);
if ($ptno == $id) {
print '<table border=1>';
print '<th> ID <th> Part <th> Count <th> Price';
print "<tr><td> $ptno </td><td>$ptname</td>";
print "<td> $num </td><td> \$price</td><tr>";
print '</table>';
$found = 1;
}
$inline = fgets($FILEH,4096);
}
if ($found !=1) {
print "Error: PartNo=$id not found";
}
fclose ($FILEH);
?>