Here bro.
I took out all that stuff in the other script that actually did nothing and
this is all you need.
It adds 1 cent every second.
PHP Code:
<html>
<head>
<script type="text/javascript">
var cents=0;
var dollars=0;
function startTime()
{
var updatesecs = 1000;
var strcents = 0;
cents+= 1;
if (cents>99) {
cents= 0;
dollars+=1;
}
if (cents<10) {
strcents = "0" + cents;
}else {
strcents = cents;
}
document.getElementById('txt').innerHTML="I have lost $"+ dollars + "\." + strcents + " while reading this post on GFY.";
t=setTimeout('startTime()',updatesecs);//time in milliseconds for the total to be updated
}
</script>
</head>
<body onload="startTime()">
<div id="txt">If you can read this something went wrong.</div>
</body>
</html>