|
Posted by programming on 04/10/07 07:52
Is there any reason why i am NOT reading each invididual line from a
txt file in this script...e.g i keep on getting 2 lines printed outed
when there are clearly
four lines in the txt file.
also, is my counter right here?
<? php
$listf = fopen ("./member.txt", "r");
# read the file
$line = fgets($listf, 4096);
while(($data = fgetcsv($listf,1024,"|"))!=FALSE)
{
$count++;
$duserid=trim($data[0]);
$dname=trim($data[1]);
list ($duserid,$dname,$actions) = split("\|",$line);
$line = chop($line); //chops space out of program
$actions= "<a href=\"./delete_member.php?record_id=29\">Delete</a> |
<a href=\"./edit_member.php?record_id=29\">Edit</a></td>";
$data = fgetcsv($listf, 1024);
echo "<tr><td>$duserid</td><td>$dname</td><td>$actions<td></tr>";
}
fclose($listf);
?>
[Back to original message]
|