Jump to content
php.lv forumi

problemas ar izvadi


knaiblis

Recommended Posts

Problēma sekojoša. Mēģinu uzraksti skriptu kas no *.txt faila tabula ataino ierakstus, bet katru reizi tiek izdots par 1 rindinu vairak neka ir *.txt failaa.

 

if($fp = fopen($litotajudb, 'r+')) {
$ligner = 1;
echo '<br>';
echo '<br>';
echo '<table align="center" border="1" bordercolor="#00CCFF" width="700">';
echo '<tr align="center"><td>ID</td><td>Lietotājs</td><td>Parole MD5</td><td>Pēdējo reizi ienācis</td></td><td>Labot</td> </tr>';
while (!feof($fp)) {
$data = fgets($fp);

list ($ID, $name, $tow, $obj ) = explode(',', $data, 4);
echo '<tr>';
echo '<td align="center" > ', $ID, '</td>'; 
echo '<td align="center" >', $name, ' </td>';
echo '<td align="center" > ', $tow, '</td>';
echo '<td align="center" > ', $obj, '</td>';
echo '<td align="center" > <input type="submit" value="Labot"> </td>';
echo '</tr>';


echo $ligner;
$ligner++;
}

echo '</table>';



fclose($fp);
} else {
exit('Error : open impossible file');
}

Link to comment
Share on other sites

×
×
  • Create New...