I'm looking for php script which adds a number of x (example 60) and ending each second, and the result displays on screen in real time. However, the final outcome as in the script js Example: <p style="float: left;"> $<div id="start" style="float: left;">1</div> </p> <script type="text/javascript">var n=1; function add(n){ document.getElementById("start").innerHTML=n; n++; setTimeout("add("+n+")",100); } add(n); </script> Code (markup): I am able to pay for it. Sorry for my English.
Can't really understand what u want? If you want to do real-time update using PHP thats impossible. We need more explanations & details
Just use jquery and setinterval (javascript). <script type="text/javascript"> setInterval("getAjaxUpdate()",1000); function getAjaxUpdate(){ $("updateResult").load="url_to_your_php_file.php"; } </script> <div id="updateResult"></div> HTML:
you must use ajax on this one, store your variable in a session so it will not restart on refresh.. add another 0 to your setTimeout function