Re: timer in PHP

From: Date: Thu, 12 Apr 2001 02:56:50 +0000
Subject: Re: timer in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48234@lists.php.net to get a copy of this message
I'm guessing it's either for a Quiz script or an Auction script. If you want to make it easy on yourself, use a database to store the starting time (when the timer "starts") and what time the test/auction should end. When someome makes a submission, get the time stored in the database and see if the person's submission is within the timelimit (check if the current time is less than the finish time). If the current time is within 2 minutes of the ending time, then take the ending time, add 5 minutes to it, and then store it. If you try to do this all in a sort of real-time, you're only making it hard on yourself and it's more or less impossible to do (without killing yourself in resources, anyway). Doing it with a database, once you get it working in the first place, may even be considered trivial. You may be pleasantly surprised...unless you can't use a database :) -- Plutarck Should be working on something... ...but forgot what it was. ""george"" <geo.mclachlan@btinternet.com> wrote in message news:9b1p05$t6c$1@toye.p.sourceforge.net... > I need to have a time running and after a certain time it will not allow > you to submit anything else, on top of that if someone makes an entry with > less than 2 minutes to go the time must be extended by 5 minutes. > I really am at a loss how to do this. > Can it be done. > > TIA > > George > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#48234) next »