[eluser]kresimir[/eluser]
I used jquery setinterval (I put 5sec for testing purpose only!) and div to check IP connection and display status in footer table column div (footer.php).
Code:
[removed]
setInterval("refresh_IP();",5000);
function refresh_IP(){
$('#refresh').load(location.href + ' #time');
}
[removed]
<div id="refresh">
<div id="time">
<?php
$host="213.191.128.8";
exec("ping -n 1 " . $host, $output, $result);
if ($result == 0)
echo "<span green; font-weight: bold'>Ok!</span>";
else
echo "<span red; font-weight: bold'>NotOk!</span>";
?>
</div>
</div>
The status is displayed when I enter into some module, but if I disconnect eth cable this staus is not change ?
This status is changed if i went into some other module ( home or customers..)
I googled and found that isnt possible to do it with php and html.
I found nice tutorial for jquery on:http://blog.codebusters.pl/en/refresh-content-automatically-after-some-period-time-jquery
Is it possible to dinamically change ONLY this status in view with jquery ?