Some Notes About Version 2 vs Version 1
- PHP4 enabled me to store the expiry data in the form of an XML file, which I feel may prove to be important in the future if this system gets extended. Perhaps I could have used PHP3 instead of PHP4, but I suspect that handling XML files is probably trickier in PHP3.
- I discovered that variables defined within the query string are not automatically available to a PHP4 script, as they are to a PHP3 script. This change was made to enhance security; PHP4 scripts have to explicitly
GET the values of input variables.
- I didn't bother trying to make the script append data to the file in alphabetical order, as it did in version 1. I've realised that there aren't very many expired pages - or at least there shouldn't be many expired pages - at any one time, so the file should never be very long.
- The function that sends out the emails will get executed the first time the script is hit on a Monday by an expired page. There is a risk that this might not happen on a particular Monday, but I don't think this is worth worrying about. I could have made the script check the file date whenever it was hit (by any page), but that would use up a lot more CPU and disk access time.
|