Skip to content

Instantly share code, notes, and snippets.

@yehchge
Created July 17, 2014 16:34
Show Gist options
  • Save yehchge/02eb0156571818981f7e to your computer and use it in GitHub Desktop.
Save yehchge/02eb0156571818981f7e to your computer and use it in GitHub Desktop.
Echo Message in Web Site.
<div id="msg"></div>
<?php
set_time_limit(0);
if (ob_get_level() == 0) ob_start();
for($i=0;$i<=500;$i++) {
//echo 'I = '.$i."<br>";
//echo str_pad('',4096)."\n";
echo "<script>\n";
echo "document.getElementById(\"msg\").innerHTML=\"I = ".$i."\";\n";
echo "</script>\n";
ob_flush();
flush();
////sleep(1);
////usleep(2000000); // 2 secs
usleep(100000);
}
echo 'Done.';
ob_end_flush();
?>
<?php
/*
echo <<<END
<html>
<title>Test Form</title>
<script>
function blankIt ()
{
document.write ("");
document.close ();
}
</script>
</html>
<body>
<center><strong>This Be's the Page</strong></center>
<div class="section" id="theThang">
<form name="elPageo" id="elPageo" method="" action="">
<center><input name="blankMe" type="button" id="blankMe"
value="Blank Me" onclick="blankIt ();">
</center>
</form>
</div>
</body>
</html>
END
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment