Results 1 to 2 of 2

Thread: [RESOLVED] Hidden download counter

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Resolved [RESOLVED] Hidden download counter

    I am currently using <a href="file"> for my downloads, I just want to have a counter for my downloads, tried googling but I think it should be easier that the ones I have found. I want it to just update a text file and I will just have a peak at it myself.

    TIA
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Hidden download counter

    This worked.
    Code:
    <?php
    
    $hit_count = @file_get_contents('counter.txt');
    $hit_count++;
    @file_put_contents('counter.txt', $hit_count);
    
    header('Location: file'); // redirect to the real file to be download
    ?>
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

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



Click Here to Expand Forum to Full Width