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.

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

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

script is pulling more then they have....
I have this script for my game where they can change there race. This will cost them 2,500 points. H

PHP form help required
Hi all! Apologies in advance for having to message the forum for help. I know you must get a lot of

If a form submits back to same page do you need to use $get
IM trying to pass page number and year that was selected back to the same page.

i have this c

query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:

Code: [Select]$query

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.

Here is the

How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse

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