All I want is to make a php page that will open a file (news.txt) for reading and while the file is opened, other users from Internet to be able to read the file by accessing the same php page.
$filename="news.txt";
$fd = fopen ($filename, "r") or die ("Can't open file\n");
while (!feof($fd))
{
$bufdata = fgets($fd, 4096);
$bufstire = fgets($fd, 4096);
print $bufdata;
print "<hr>";
print $bufstire;
}
#fclose ($fd);
Is thes correct or i should use flock ?
Where should i use flock ?
I would appreciate any answer.