View Single Post
Old 05-12-2011, 06:54 PM  
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,231
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) {
    
cents0;
    
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> 
__________________
Make Money with Porn
blackmonsters is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote