add to database when user downloads a file

Codes here !

Moderators: macek, egami, gesf

Post Reply
User avatar
freshnet
php-forum Active User
php-forum Active User
Posts: 342
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Re: add to database when user downloads a file

Post by freshnet » Thu Mar 22, 2012 3:43 pm

definitely. I'd do it using a form, then you can use

Code: Select all

isset($_POST['submit'])
to test whether the form has been submitted. You can then use if to run the query.

User avatar
freshnet
php-forum Active User
php-forum Active User
Posts: 342
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Re: add to database when user downloads a file

Post by freshnet » Thu Mar 22, 2012 4:36 pm

Do you have your database created or a basic knowledge of PHP/SQL?

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 578
Joined: Fri Aug 05, 2011 9:53 am

Re: add to database when user downloads a file

Post by NigelRen » Thu Aug 02, 2012 11:28 pm

It would be worth creating a new database table which has the user and the file identifiers on it. Then when a user has downloaded a file you can insert a record into this table which indicates which user has downloaded which files. You could include a date as well so that you can see when they have downloaded it.
Have a go at creating the table and writing some code, if you still have problems then post your code and I'm sure someone will help.

Post Reply

Who is online

Users browsing this forum: element121 and 1 guest