Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    download counter problem

    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:

    misc/file.zip?id=[01]

    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!




    ******
    Setup:
    ******
    - 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

    ********************************************
    Last edited by AshleyQuick; 12-30-2003 at 09:56 PM.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I didn't understand all that, but i think you should linkt to the file like

    misc/file.zip?id=1

    --> 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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •