Hello
I\'m still having troubles while showing my webcam images onto a PHP page. Using the server push, I can show the correct image (snapshot.jpg) onto my page, but unfortunately it doesn\'t refresh. The page containing the image is sent to the browser every second, and my webcam image is updated every 5 seconds. However, even after 10 seconds the page still shows the original picture. I added several \"cache\" headers to ensure that the picture would be refreshed every time the HTML is sent to the browser, but this didn\'t help. Can someone tell me how to ensure that the updated image is loaded in the IMG-tag, and not the original picture?
Thanks a lot!
Here\'s the (simplified) script I\'m using :
<?php
$end = \"Finish\"; // random string
header (\"Content-type: multipart/x-mixed-replace;boundary=$end\");
header (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past
header (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // Always modified
header (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1
header (\"Pragma: no-cache\"); // HTTP/1.0
print (\"--$end\n\"); //Start data block
$i=0;
do {
print (\"Content-type: text/html\n\n\"); //Define content type
print (\"<BODY>\");
print (\"<CENTER><IMG SRC=\\"snapshot.jpg\\" WIDTH=150></CENTER>\");
print (\"</BODY>\");
$i++;
if ($i==20)
print (\"\n--$end--\n\");
else
print (\"\n--$end\n\"); //Start data block
flush();
sleep(1);
}
while ($i<20);
?>