Hi, i have a limit i am setting on my chatroom they have a certain mount of time to chat (i have a good reason)
anyway so i have the time set in a var
I post the var on the page "you have this much time" (its depending on the member status)
I got a redirect script but it just does seconds, then i found a few countdown script but all of them had issues either the seconds didnt work or when the seconds go to 09 it froze.
Anyway long story short i been at this for 6 hours now and i cannot seem to find a good script that i can load a value hour min sec into and have it countdown.
or load hour min sec into and have it count from zero to that amount.
i found phils on a thread here but again it only does seconds.
I have tried to take the code from one and put it into another but im totally upside down now. lol
what i start with is this 00:00:00 h m s and i get that by
PHP Code:
//creditworth_sec is how many total seconds
$chatallowed = gmdate("H:i:s", $creditworth_sec);
my plan is to redirect when the time is up either count up or count down
thanks
UPDATE i ripped it all out and starting over. I know that phils works, ty phill

so what i might do is just use his to count down 60 sec at a time on the screen.
then every loop add one to a counter and display that total on the screen in a div, then when that total equals my total do the redirect. i dont do partial min so it will be full min.
how does that sound, to me it sounds so much less complicated than calculating seconds and converting and all that.
UPDATE again lol. Ok i like that i idea forget the original id.
here is what i have i like this much better. ill be back if i need help and phil thanks again nice job ..
PHP Code:
<script type="text/javascript">
/*author Philip M. 2010*/
var minutes=0;
var timeInSecs;
var ticker;
function startTimer(secs){
timeInSecs = parseInt(secs)-1;
ticker = setInterval("tick()",1000); // every second
}
function tick()
{
var secs = timeInSecs;
if (secs>0)
{
timeInSecs--;
}else {
clearInterval(ticker); // stop counting at zero
startTimer(60); // remove forward slashes in front of startTimer to repeat if required
minutes = minutes + 1;
}//close else
document.getElementById("countdown").innerHTML = secs;
document.getElementById("minutes").innerHTML = minutes;
}//close function tick
</script>