Hi all, here’s what I’m aiming to do:
I have an XML file, quotes.xml, which contains several quotes from different famous people.
What I want to do is pull in one quote at a time. I’ve no problems doing this – it’s working perfectly with a random quote being pulled into a web page each time.
However, I need the page to ‘cycle’ through the list of quote entries in the XML. I.e., one day it will use the first quote, then after 24 hours it will use the second quote, 24 hours after that it will use the third quote, etc. When it reaches the end it will start from the beginning again.
The method I’ve thought of was in creating a file on the server which stores something like $lastQuote = 6; and somehow checks this every day, changes it to 7 and starts using quote number 7.
This seems like it may be unnecessary though, and surely opening and reading a file every time the page is loaded would use many server resources? Can someone suggest the best way of going about doing this?
Many thanks in advance