J'ai fini par trouver une solution :
FICHIER test.php :
<?php
session_start ();
?>
<script type="text/javascript">
function update() {
var xhr_object = null;
//alert("debut!");
if(window.XMLHttpRequest) // Firefox
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // Internet Explorer
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else { // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
return;
}
xhr_object.open("POST", "furnace_view.php", true);
xhr_object.onreadystatechange = function()
{
if(xhr_object.readyState == 4)
{
document.getElementById('img').src = xhr_object.responseText;
}
}
xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr_object.send(data);
}
setInterval("update()",5000);
</script>
<img src="" id="img" />
FICHIER furnace_view.php :
<?php
session_start ();
if (isset ($_SESSION['image'])) {
if (file_exists ($_SESSION['image'])) {
unlink ($_SESSION['image']);
}
}
$code = '';
$chars = '0123456789';
for ($i = 0; $i < 6; $i ++) {
$code .= $chars {mt_rand (0, 9)};
}
$im = @imagecreate (100, 50)
or die ("Impossible d'initialiser la bibliothèque GD");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, $code, $text_color);
imagepng ($im, $code.'.png');
imagedestroy($im);
$_SESSION['image'] = $code.'.png';
echo $code.'.png';
?>