function main()
{
- $st = 0;
+ GLOBAL $st;
+
+ if (!isset($st)) {
+ $st = 0;
+ }
+
$fp = fopen("/tmp/test-hs-rd.log", "a");
fwrite($fp, "START\n");
fclose($fp);
// exit();
sleep(30);
}
- printf("<script id='hs%d' type='text/javascript'>
-push(\"$('cont').innerHTML += '%s %d';\");
-</script>", $i, ($first ? "<br/>" : ""), $i);
+
+printf("<script id='hs%d' type='text/javascript'>
+push(\"$('cont').innerHTML += '%s %d'; gst.st = %d;\");
+</script>", $i, ($first ? "<br/>" : ""), $i, $i);
if ($first)
printf("<!-- %s -->", $s);