I'm writing a "mail a postcard to a friend" script. Without access to a database, I'm going to use flat text files, and plan to do it thusly:
"Sent" postcards are recorded to a delimited file:
Then the script will generate a small ".htm" file which will hold the <img src> and message, which will later be called and read by the script when the recipient clicks the link
<a href="domain/cgi/script.cgi?$id::$recip_name">Retrieve your postcard</a>
Is this a logical way of doing this? I don't anticipate a very high volume of postcard traffic. (Like 10/ month MAX). Am I doing it the hard way, or can someone recommend a better way?
Then I need a way to delete the files after they've expired (say 10 days?) but I have *NO* idea on how to calculate this. I suspect I can write a function to "unlink" all .htm files > 10 days, right? But I don't know how to calculate the time elapsed.
Can anyone please help me? Snippets of code would be ideal.