I hope someone has suggestions for a solution.
I am fetching data from an external location and it may take 20 seconds. I would like to show that data is being downloaded.
When the data has been received, the information that the data is being downloaded must be replaced with a receipt that the data has been retrieved successfully.
Sorry for my English, but I hope you understand.
I am fetching data from an external location and it may take 20 seconds. I would like to show that data is being downloaded.
When the data has been received, the information that the data is being downloaded must be replaced with a receipt that the data has been retrieved successfully.
Sorry for my English, but I hope you understand.
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da" lang="da">
<head>
<title>Read data from watermeter</title>
</head>
<body>
<!-- Show this when website load and hide this when data is received-->
<div class="showOnLoad">
Receiving consumption - it can take up to 20 seconds.<br /><br />
<img src="downloading.gif" alt="animated gif"><br /><br />
</div>
<!-- Hide this when website load and show this when data is received-->
<div class="hideonLoad">
Congratulations, the data has been received..<br /><br />
<img src="thumbsup.gif" alt="thumbs up gif"><br /><br />
</div>
<?php
//Call extern watermeter and retrieve data
$result = file_get_contents('https://domain/data/cmd.php');
print_r($result);
?>
</body>
</html>