<?php
$i = 0;
while (true) {
if($i == 0) {
echo "<html><body>";
}
echo "<script type='text/javascript'>\n";
echo "alert('hello');\n";
echo "</script>";
if($i == 0 ) {
$padstr = str_pad("",2048," ");
echo $padstr;
echo "</body></html>";
}
flush();
sleep(5);
$i = $i + 1;
}
?>
For the first time, send at least 2048 bytes of data. then it will work fine. And don't forget to save the script tag in the body tag. The strange thing is, in my case, if I add 1024 bytes, it worked. Hope this helps you.
The above program works fine in google chrome.
prajwala
source
share