Hi,
I am working on a system, as you may have seen from my other posts, that allows members to download files. When they download a file I want to store the user ID and the file ID in a table along with the last download time and how many times they have downloaded.
I have the SQL for this already - so no problems there.
Unfortunately you can't use AJAX for this as the code in the onclick() won't fire if there is a URL in the href - the default handler for the URL is fired in stead.
So my idea was simple. Have the link go to a php page that updates the table in the database, downloads the file and then returns the user to where they were originally.
This leads me to my question. How do you download the file in PHP? It may a php file, an m3u file or anything for that matter.
I've read around the low level file functions but all this will do, as far as I can tell, is put the file contents into a local variable. How can I get the file to the clients PC and store the fact that they have done so?
Any help, suggestions or pointer greatly appreciated.
Cheers
nathj
PS How do you get the email notification and signature to set for every post - I have to keep editing my posts to set it?
I am working on a system, as you may have seen from my other posts, that allows members to download files. When they download a file I want to store the user ID and the file ID in a table along with the last download time and how many times they have downloaded.
I have the SQL for this already - so no problems there.
Unfortunately you can't use AJAX for this as the code in the onclick() won't fire if there is a URL in the href - the default handler for the URL is fired in stead.
So my idea was simple. Have the link go to a php page that updates the table in the database, downloads the file and then returns the user to where they were originally.
This leads me to my question. How do you download the file in PHP? It may a php file, an m3u file or anything for that matter.
I've read around the low level file functions but all this will do, as far as I can tell, is put the file contents into a local variable. How can I get the file to the clients PC and store the fact that they have done so?
Any help, suggestions or pointer greatly appreciated.
Cheers
nathj
PS How do you get the email notification and signature to set for every post - I have to keep editing my posts to set it?
Comment