Hey guys,
Just a quick question, is it possible to create a script that changes a banner image every hour? I'm looking at something for my radio station, but can't get this script to work. What I've got at the moment is:
Bearing in mind my server is currently GMT-1 so its 21:45 now on there, its permenantly showing the offline image. The echo sections at the bottom are telling me it should be working, but its not.
Just wondering if anyone could guide me as to what to do about this script, its got to be able to handle a few DJs, and manage to keep updated with each hourly show.
Thanks.
Edit:
For the image to display, there is a <img> tag on the page, with a php echo of the $img, So it does actually show up on pages.
Tried that, but for some reason, the website caches the image nomatter what I try. I've tried all sorts of things to clear the memory of the image, but they don't want to work.
Tried that, but for some reason, the website caches the image nomatter what I try. I've tried all sorts of things to clear the memory of the image, but they don't want to work.
Ok, I've installed that script to a page, and its still coming up with the same error for me. I've left the times as set, and the server time is about one hour out compared to my timezone, and its refusing to show either of the set offline images. I'll post the link to you guys, but for me its still showing up as the one image, and doesn't change when the configuration does. Link
Can you guys please tell me what you get for this, as I don't know if its my machine caching the file, or whether my host is just generally buggered.
Thanks.
Edit: Found a quick and easy fix for this.
Whilst browsing W3Schools for a PHP fix, I found this in the Javascript section, thought I'd post it just in case anyone needs the script:
var d = new Date();
var time = d.getHours();
if (time == 20)
{
document.write("<img src='images/adam.png' border='0' />");
}
else
{
document.write("<img src='images/offline.png' border='0' />");
}
Ok, I've installed that script to a page, and its still coming up with the same error for me. I've left the times as set, and the server time is about one hour out compared to my timezone, and its refusing to show either of the set offline images. I'll post the link to you guys, but for me its still showing up as the one image, and doesn't change when the configuration does. Link
Can you guys please tell me what you get for this, as I don't know if its my machine caching the file, or whether my host is just generally buggered.
Thanks.
Edit: Found a quick and easy fix for this.
Whilst browsing W3Schools for a PHP fix, I found this in the Javascript section, thought I'd post it just in case anyone needs the script:
This script is currently working without fail, so I'm hoping for the best in the future with it.
Thanks to all those who helped me work this one out.
Problem Solved. Thread Can Be Closed.
so when someone comes to your site without javscript, they get nothing? And the javascript solution is client-side meaning it is according to the user's time settings, not the servers with the php, did you at any chance echo the output times from the server and matched that to the script?
Its just a small box banner, the website still looks complete without it. People without Javascript are advised to get it, but its only a school radio, so they're not vital, just helpful.
The javascript solution is client-side meaning it is according to the user's time settings, not the servers with the php, did you at any chance echo the output times from the server and matched that to the script?
Its just a small box banner, the website still looks complete without it. People without Javascript are advised to get it, but its only a school radio, so they're not vital, just helpful.
Like I said, its only a small school radio, so most of our listeners are in the same timezone.
But I've just left it blank being as they're not exactly missing out on much.
And they probably have got a real bad server because its a free web host. They've managed to block most php expressions for 'security reasons' which is why I was trying to find a way round it.