I would like to monitor my program which is running on the web server.
Can I draw the progress bar or simply show the percentage which is returned by my code?
The php script is spawning the external code with parameters.
$Status="rendering...";
$cmd = "cd $rpath && $envopts /home/arm2arm/bin/sph2grid";
$shellcmd=$cmd.$params.'| tee sph2grid.log ';
echo '<strong>'.$shellcmd.'</strong>';
$tmp=shell_exec($shellcmd);
then after all I am showing the log file:
<?php
function ViewLog() {
$string = file_get_contents('../../PHP-Login/tmp/sph2grid.log');
$string = str_replace("\n", '<br>', $string);
echo $string;
}
?>
Can I bind the output of my application to some "<div>"?
Thanks in advance.
Arman.
U can use javascript to setup a timer interval that spawns ajax processes to poll a php page where the percentage is being output. you can then grab the response of that page and append it to a div:
in percentageComplete.php you need to get the percentage completed of the calculations