OLD CODE:
Code: Select all
$sep = "sOmErAnDoMsTrInGfOrBoUnDaRy";
$header = 'Content-Type: multipart/x-mixed-replace;boundary=' . $sep;
header($header);
header("pragma: no-store,no-cache");
header("cache-control: no-cache,no-store,must-revalidate,max-age=-1");
header("expires: -1");
$boundary = "\n" . $sep . "\n";
echo $boundary;
set_time_limit(0);
while (1) {
$handle = fopen("image.jpg", "rb");
if ($handle != false) {
$imageContents = "";
while (!feof($handle)) {
$imageContents .= fread($handle, 4096);
}
fclose($handle);
echo "Content-Type: image/jpeg\n\n";
echo $imageContents;
echo $boundary;
ob_flush();
flush();
usleep($waitTime);
}
}NEW CODE:
Code: Select all
$sep = "sOmErAnDoMsTrInGfOrBoUnDaRy";
$header = 'Content-Type: multipart/x-mixed-replace;boundary=' . $sep;
header($header);
header("pragma: no-store,no-cache");
header("cache-control: no-cache,no-store,must-revalidate,max-age=-1");
header("expires: -1");
$boundary = "\n" . $sep . "\n";
echo $boundary;
set_time_limit(0);
while (1) {
$handle = fopen("image.jpg", "rb");
if ($handle != false) {
echo "Content-Type: image/jpeg\n\n";
while (!feof($handle)) {
$imageContents = fread($handle, 1024);
if ($imageContents != false) = echo $imageContents;
}
fclose($handle);
echo $boundary;
usleep($waitTime);
} else usleep($waitTime);
}