Hi all,
I am reading data from a file. There are two rows of data.
Row 1 must be assigned to label 1
Row 2 must be assigned to label 2
How do I do this?
Below is my code. Thanks.
<?php
while(!feof($fp))
{
$num = count($fp);
//echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
$data = fgets($fp, 999);
for ($c=0; $c < $num; $c++)
{
echo '<p>'.$data . "</p>\n";
?>
<p>
<label for="label1" >Label 1</label>
<input type="text" name="label1" value="" />
</p>
<p>
<label for="label2" >Label 2</label>
<input type="text" name="label2" value="" />
</p>
<?php
} // END IF
} // end while
fclose($fp);
?>