Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-27-2004, 09:11 PM
WebProWorld New Member
 

Join Date: Jun 2004
Location: Romania
Posts: 8
Nicky21 RepRank 0
Default How to keep track of downloads ?

Hi there.

I've come across a problem. I want to keep an exact track of my downloads, so i know precisely how many are each day and so on....

How do i do this in html + php?

I mean how do i do this so:
- it won't need an aditional page, with just a huge link on it that says "click here to begin"
- the stuff won't be stopped by popup blockers
- when the user clicked the link or button or whatever, the download will start and a php file will be called immediately so i can add the click to a database

Any idea guys?
__________________
Traian Trante,
www.crea-soft.com
Reply With Quote
  #2 (permalink)  
Old 10-28-2004, 06:31 AM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 862
speed RepRank 1
Default

Assuming you are downloading ZIP files:
Code:
<?php

// Add counter update code here

// Send the file
header("Content-Disposition: filename=\"thefilename.zip\"");
header("Content-Type: application/zip");
@readfile('/path/thefilename.zip');

?>
On your page make the link point to this PHP file rather than the actual file.

If you are not downloading ZIPs then you will need to change the Content-Type appropriately.
__________________
US & UK Web Hosting with hourly backups | Hosting Affiliate Scheme | Web Directory 2 for 1 Offer
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0