I am creating an online flash game where images would be randomly drawn from an XML file. If the player gets the winning image, he would get a link to click on which leads to a form where he/she can enter details... But I need only ONE winner a day and still give the other players SAME EXPERIENCE without knowing the prize was already won today... I am not sure this is the best approach, but I thought PHP might be able to handle this easily: One I have a winner who gets to the form, fills in his details and sends this off, I would need to change the XML (comment out winning Image url, or get rid of that line or switch between 2 XML files...) so I will not have another winner for the next (24 hour, or till midnight...), when the previous XML file would be available again... Is this a good approach or am I completely wrong? Thanks very much.
yeah, looks like a good course you can use php's file writing toolset for that http://www.php.net/file
thanks much, that looks like what I need, how about the time aspect of the thing? ( for example every day on midnight change back the XML)
The easiest I can think for this is to make an array with path names of images to use. Make a writable text file. Log the winning image path to this file. Now your php just needs to check if this file is empty or not. If not, it will not show a winner for that day again. (winner exists) Set a cron to empty this file at midnight. regards