Anyone know a script

royboywales

Junior Member
Nov 27, 2008
1
0
0
I have a website and I wish to automate an action. Life would be so much easier if I could find a script that could put a notice (picture) on my site from 8am to 7pm the at other times change the picture to different one. Bit like a shop sign open/closed

I would be forever indebted to someone that can help me with it.

Thanks in advance. Royboywales
 
Oct 27, 2007
17,009
5
0
Need more details on your server and web framework. Is this just HTML or is the page running on a PHP server/.NET server? If you're on a Linux box then probably a cron job would be your best bet, but someone else will have to help you with the details.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,663
4,603
75
It seems like this wouldn't be too hard in Javascript. The hardest part might be making sure everyone in the world found what time it is for you. Here's a way to do that. Then just set the src of an img tag to whatever's appropriate for that time. Be sure to also have a default image for those who disable Javascript, like myself.

Of course, I haven't actually tried any of this...
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
Here's what I'd do. Set up an IMG tag with the SRC set to something like /openSign.aspx or .php or whatever. In the page you write out the bytes of the image you want to display. It's in this page that you do your check for what time it is. Make sure you set the response-type header correctly... remember you're writing out binary data, not text.