Inverval Of Time
Posted: Wed Mar 08, 2006 3:24 pm
Ok, I have a question on how to do an interval program.
This is what I would like, have some text on a webpage display for X amount of seconds at X amount of seconds in between . Seems simple enough but I was hoping to do it without a database. This is what I have come up with so far..
This possible? Thanks in advance
This is what I would like, have some text on a webpage display for X amount of seconds at X amount of seconds in between . Seems simple enough but I was hoping to do it without a database. This is what I have come up with so far..
Code: Select all
$ShowLength=5; # Amount of seconds to show on the page, after this is up stop displaying
$StartBase="946702800"; # The unix base date to work with, Jan 1st 2000 00:00:00
$Interval =40; # Amount of seconds between displays
/*
It should be global, meaning that everyone sees this on the page
at the same time so no COOKIES or SESSIONS
*/
$VarLTime=time()-$ShowLength;
if(time()-$ShowLength < ($StartBase * something )+$ShowLength something )echo "Text";