View Full Version : Change image and text daily
Bornfree
08-19-2008, 09:30 PM
Hi Guys,
I wish to add this feature to my site, where am image with some description, changes on a daily basis. i have 4 images with description at the moment. Something similar to this site www.elsema.net
thanks for your help
You'd have a few options when make a script like this.
Your first one is to use PHP and MySQL, this is one I highly suggest. And could be very simple to make. All you'd have to do is make a simple tables:
| title | description | imageUrl | Date |
+-----------------------------------+
| First | First| first.png | 24 |
-------------------------------------
As you can tell, I'm not good at making those. :)
And then you'd have a simple query:
SELECT * FROM `tableName` WHERE `Date`=$today
The second way is also suggested, just not that high. :)
What you would do is have a page for each day of A moths, so 31 pages. that have the content you like on it. From there you would just include the page, thats the current day.
For example:
include("includedPages[".date('j')."].php");
So that would include(assuming the date is the 19th:
include("includedPages[19].php");
You can do also almost the same thing with javascript using frames, instead of includes. But I really don't suggest that. Although if you could get it to work with ajax, that'd be cool.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.