Jump to content


Download file update dastabase url and form.

  • Please log in to reply
1 reply to this topic

#1 redarrow

  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 01 April 2006 - 07:44 AM

if you wanted to download a file via the form or the url how do you do that then update the database colum by one.

if a user press a link click here they get the file, Then the database gets a 1 in a colum and then it increments as people download the same file updating that colum.

and in another colum with the number starting at 1000 a count down happens on any file downloaded a 1 is tacken away from the 1000.

Code example BUT NEEDS HELP for download file and update database by 1 then total_downloads - 1 from 1000.



$link="<a href='http://$filename'>get file</a>";

echo $link;

if ($_post($filename) {

$result = mysql_query("UPDATE download_info SET how_meny_times='+1'") 
or die(mysql_error()); 

} elseif { 

($_post($filename) {

$result = mysql_query("UPDATE download_info SET total_downlaods='-1'") 
or die(mysql_error()); 


// In how_meny_times field got the number o.

// In total_downloads field got the number 1000 in.


Wish i new all about php DAM i will have to learn

#2 jmag

  • Members
  • PipPip
  • Member
  • 22 posts
  • LocationSweden

Posted 01 April 2006 - 09:42 AM

I think easiest way would be to have two pages. One page listing downloadable files, then when a user clicks a file they are redirected to another page which updates the database and serves them the file.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users