Re: PHP images and time
- From: larry@xxxxxxxxxxxxxxxxx
- Date: Thu, 19 Jul 2007 06:51:10 -0700
On Jul 18, 11:49 am, Maureeze <maure...@xxxxxxxxx> wrote:
Hello there,
I want to add a php script to my page that changes my collection of
images based on the time of my computer. So, every 5 seconds i want to
change the picture on the site, but it should not be random. It should
be based on time, so to put it simply: I want to see the same picture
at 12:00 noon every day and the same picture at 16:00. Is this
possible with PHP or should i use something else..
Thank you sooooo much.
Kind regards,
Maurice
Not too hard, you need to take the time usingf date("G") (hour from 24
hour clock, add i for minutes) and divide by how many images you want
to display, and then use that result to build your filename for your
img tag on your page.
Now this is only for server time, getting the time from a client
machine is I think virtually impossible (without some sort of client-
side script).
.
- References:
- PHP images and time
- From: Maureeze
- PHP images and time
- Prev by Date: Re: [PHP] Re: Pirate PHP books online?
- Next by Date: RE: [PHP] Pirate PHP books online?
- Previous by thread: PHP images and time
- Next by thread: Re: [PHP] Re: Pirate PHP books online?
- Index(es):
Relevant Pages
|