I needed something similar a while back for my own project. I know I'm a "little" late but I'm hoping this could help other people looking for the same solution.
First, make a file. Let's call it data.php. This file should contain all your code to retrieve data from your database and this is where you put any relevant data into variables. This is some example code from my own project:
<?php
$cpu_load = sys_getloadavg();
$total_storage = disk_total_space("/");
$free_storage = disk_free_space("/");
$public_ip = file_get_contents("public_ip.txt");
?>
All this code does is it sets the variables and this is the only bit that will periodically be refreshed. You also need to add the contents of the DIV here (without the DIV tags though). This part should look something like this (obviously replacing my example variables):
<table width="838" cellpadding="1" cellspacing="1" class="categorie1">
<tr style='font: bold 12px verdana;'>
<td width="149" align="center">Average CPU Load: <?php echo $cpu_load; ?></td>
<td width="99" align="center">Total Storage: <?php echo $total_storage; ?></td>
<td width="248" align="center">Free Storage: <?php echo $free_storage; ?></td>
<td width="103" align="center">Public IP: <?php echo $public_ip; ?></td>
</tr>
</table>
Next, in your main page you could use something like this:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function() {
$("#refresh").click(function() {
$("#last10").load("data.php");
return false;
});
});
function refresh() {
$("#refresh").click();
}
setInterval(refresh, 100);
</script>
<a href="#" id="refresh" hidden="">Refresh</a>
<div id="last10"></div>
This simply creates a hidden link and "clicks" it to refresh the div.
I think this should answer your question. Ask in comments if you need any clarification. Hope this helps some people :)