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

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

file downloaded can't be read !!
<?php
$fileName = 'mypic.jpg';
$mimeType = 'image/jpeg';
header('content-dispositio

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

switch not getting value
what am i doing wrong?
i want to populate the country list according to the category
i want to

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel

Date help - fetch dates for Mondays between xxx and yyy?
Does anyone know the best way to do this? I have two dates, say:

2010-01-26 and 2010-05-30

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

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