Time-based image rotation script


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the script to show day.jpg from 6 AM to 6 PM, and to show night.jpg from 6 PM to 6 AM.

I also need the rotation to take place based not on server time, but on the local time of the user viewing the page.

Did you know?Explore Trending and Topic pages for more stories like this.
I've Google-searched this for hours and only found stuff that is similar but doesn't do what I want. I don't want the rotation to be "every X minutes" and I don't want it to be based on the date, but rather on the exact time of day based on a user's local time.

Thanks
No comments posted yet

Your Answer:

Login to answer
260 Like 50 Dislike
Previous forums Next forums
Other forums

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the co

Inserting into MySQL Newbie
Hi ive got a slight problem where ive made a simple web form where the customer inserts the ammount

why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?

Tha

PHP login form help (Done Most of It)
Hi i am having a problem, when i try logging in it is always saying "Invalid Login" im not

Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

Why is the logic of this simple code not working?
Hey, I'm trying to determine if a table already exists in mysql, but doing a query first with mysql_

Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash