Unanswered: Turn link to ZIPfile into PHP script that logs the download
I have a page that contains a link to a ZIP-file.
I want to monitor the downloading of the file. Instead of delving into the weblog, I want to write a timestamp to a file.
I can change HREF=myfile.zip into HREF=logmyfile.php
and let logmyfile.php write the timestamp to a text file.
However, how can I tell PHP that the zipfile should be send to the user after the log has been appended, resulting in the display of the dialogue box that gives the user the choice to Open the file or to Save it to disk?
I am flabbergasted by the simplicity of your suggestion.
Will give it a try. For sure I must look at the documentation of the possibilities of the header function. I was aware that it could be used to store cookies, and that header() doesn't work if any output already has been sent. Obviously, it's capable of much more.
Thanks for your suggestion.
Originally posted by lslars31
// Open text file, add timestamp, save, and close text file