Code: Select all
if (file_exists($file_name))
{
while (true)
{
$read = file($file_name);
$read = $read[0];
if ($read == 0)
{
sleep(5);
}
else
{
echo "Worked!!!";
}
}
}The problem is that if I have launched the page, I cannot go anywhere else on my site, it just hangs. And if the file value was indeed 1, and I refresh the page. It executes the php before the html is shown, so the user would see the previous html and not the new html.
What can be done to get around this problem?