bash - HowTo run a ShellScript in PHP in loop -
I have a shell script which is hidden in a php file to get the temperature.
& lt ;? Php $ output = shell_exec ('sh temperature.sh'); Echo "& lt; east> $ output & deg; c ;"; ? & Gt; It has just exited once. I always need to change the php file so that the price is always up to date?
Thanks
PHP is a server side language This means that when it is full, it is done if you want to always update it, then you should use AJAX calls for it. var interval = 1000; // 1 second function doAjax () {$. AJAX ({type: 'GET', url: 'get_what_you_want.php', data: {}, data type: 'jason', success: work (data) {$ ('body') .text (data) // Put it on your page}, complete: function (data) {// next set timeout (doAjax, interval);}}) Schedule; } SetTimeout (doAjax, Interval);
Comments
Post a Comment