Jump to content


Photo

Download hit counter


  • Please log in to reply
3 replies to this topic

#1 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 27 May 2006 - 09:00 AM

How can I make a downlaod hit counter with PHP? I want to know how many downloads the people do on ym website.

Thanks before.

#2 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 27 May 2006 - 11:49 AM

[!--quoteo(post=377527:date=May 27 2006, 07:00 PM:name=turbocueca)--][div class=\'quotetop\']QUOTE(turbocueca @ May 27 2006, 07:00 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
How can I make a downlaod hit counter with PHP? I want to know how many downloads the people do on ym website.

Thanks before.
[/quote]


simpliest way is to have a php file, database, and of course the file to be download.

download.php for example, will query database, add 1 to the counter field, then direct using Header to the file to be download.

If you need futher explanation on this method, I'd happy to help.
Life's too short for arguing.

#3 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 27 May 2006 - 06:56 PM

Thanks for your help.
The DB is created and the file is created but now I don't know how to call the download.

#4 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 28 May 2006 - 10:37 AM

<?php
// Add 1 to counter, dont echo anything
header("Location: http://www.site.com/folder/file.extension");
?>

Orio.
Think you're smarty?

(Gone until 20 to November)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users