View Full Version : download counter problem

12-30-2003, 09:54 PM
Can someone take a look at this script and tell me how to link a file so that this script can track it?

I have this at the top of the page that contains the file:

<? include("xDownloads/func.inc.php"); ?>
<? oneDL("[01]"); ?>

...and I'm linking the file like this:


The admin area is working and the data.txt is chmoded correctly. Their site is x-dev.de (I've tried obtaining support there but they're not very articulate with English). If you know of something better, please divulge!


- set up the var's in download.php AND func.inc.php (DONT FORGET TO CHANGE YOUR PASSWORD)

- upload download.php, func.inc.php & data.txt into a directory on your server

- chmod 666 or 777 data.txt (666 does not work with some servers, then try 777)

Use of Scripts:
- open the admin-area [http://path/to/script/download.php?act=admin ] [Password: test] and add your downloads

- Linking* to download.php?id=[ID] - counts downloads and sends informations via header to the browser
*[ID] = your download-ID

- if you want to start the downloads with browser-refresh instead of header add this to the download-url: &go=browser

- NOTE: please don't open download.php directly

Adding download-counters to your pages:

- the page with the links must be a .php or .phtml file

- add this at the top of your page: <? include("path/to/func.inc.php"); ?>

- to show all download-IDs in a table, add this to your site: <? allDL(); ?>

- to show the count of an unique download, add this code*: <? oneDL("[ID]"); ?>
*[ID] = your download-ID

- to show the last downloaded file*, add this: <? lastDL(); ?>
* shows only the ID, not the filename or path


12-31-2003, 01:02 AM
I didn't understand all that, but i think you should linkt to the file like


--> i assume it's a clasic variable-value pair in the querystring.

Your counter then would be
<? oneDL("1"); ?>

The 1 is your download-ID