Re: question on time-based function

From: Date: Fri, 19 Jan 2001 18:28:42 +0000
Subject: Re: question on time-based function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-35679@lists.php.net to get a copy of this message
Thanks Brian, I should have provided that detail. Unfortunately it is on a Windows machine.. anyone know of a schedule for IIS that would do the same thing? Rudy ----- Original Message ----- From: "Brian Clark" <brianj@fusionwerks.com> To: "PHP is not a drug ." <php-general@lists.php.net> Sent: Friday, January 19, 2001 3:56 AM Subject: Re: [PHP] question on time-based function > > Hello Rudy, > > (RM == "Rudy McDaniel") rudy@pegasus.cc.ucf.edu writes: > > RM> Anyone have any ideas on how to make a function reset every > RM> 24-hours? For example, I have a function that grabs a random quote > RM> from a file and selects a new one every time the page is reloaded. > RM> What I want, however, is for the quote to remain the same for a > RM> day and then reset at some specified time (say midnight) and grab > RM> a new random quote for the next day. It seems like their should be > RM> any easy way to do this using mktime( ) or a similar function but > RM> I'm not fully grasping it. Any ideas on how to do this would be > RM> much appreciated. > > Why not just make cron (once a day) read the quotes file, pick a > random line, write the quote to a file called quoteoftheday.php, then > just include() that file into your page? > > Unless you're running this one a windows machine.. in that case you > might be able to do the same thing with some scheduler instead of > cron, I'm not sure. > > -Brian > -- > Opportunity makes a thief. -Francis Bacon, 1598 > > > > -- > 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 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.general (#35679) next »