A complete example would be...
PHP Code:
<?php
$filename = "test.dat";
while (1) {
$filecontents = read_file($filename);
$content = htmlspecialchars($filecontents, ENT_COMPAT, 'utf-8', false);
echo $content;
flush();
ob_flush();
sleep(60); // read temperature every 60 seconds
}
/* +-------------------------------------------------------+
| read file - function |
| file can be any qualified path including web urls. |
| $filename = "http://www.example.com/some/file.txt" |
+-------------------------------------------------------+ */
function read_file($filename) {
if (file_exists($filename)) {
$filedata = file_get_contents($filename);
return $filedata;
} else {
echo "File not found";
}
}
?>
Thanks,
jwzumwalt
(\__/)
(='.'=)
(")_(")
jwzumwalt
(\__/)
(='.'=)
(")_(")