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

Hashing?
Hi, I was hoping to take a string value then convert it - consistently - across each of our pages in

Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice

Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would

Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.

when I go

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year change

firefox wouldnt stream mp3 files completely from my php page
hi everyone,
I have a php file trying to read and stream mp3 files. It works fine in IE but my pr

Linking with Foreign Keys
I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name v

Email with Attachments in PHP
Hi Friends

How to send email in PHP with attachment.
I know simple mail can be sent with

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

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