Results 1 to 6 of 6
  1. #1

    Download manager script that can hide true url

    Hello, does anyone here know a download manager/tracker script (PHP) that can hide 'true url'?

    so its like this, even when you download, the true url (path) is still hidden.. coz we dont want leechers to... u know...

    Thanks.
    Last edited by Kuroro Luc; 04-24-2004 at 05:03 PM.

  2. #2
    Join Date
    Sep 2002
    Location
    Illinois
    Posts
    2,304
    download.php
    ----
    PHP Code:
    <?php

    // assuming $filename is defined

    $basename basename($filename);

    header("Content-Length: ".filesize($filename)); 

    header("Content-Disposition: attachment; filename=".$basename); 
    header("Content-Type: application/x-force-download; name=\"".$basename."\""); 

    readfile($filename);

    ?>
    Good luck!
    How's my programming? Call 1-800-DEV-NULL

  3. #3
    Thanks, I'm going to try it now...

    I believe the $filename we change it into the file url path?

    And how about built in the log script as well? every download is logged with counts and user information ( IP address, host name, file name, date, time, referring site and user agent. )

  4. #4
    Join Date
    Sep 2002
    Location
    Illinois
    Posts
    2,304
    I gave you the basic algorithm. Everything else you have to figure out by yourself.

    Programming is about thinking (c) null
    How's my programming? Call 1-800-DEV-NULL

  5. #5
    Join Date
    Mar 2002
    Location
    England
    Posts
    2,014
    Basic idea of logging with MySQL

    PHP Code:
    $conn mysql_connect('host''user''pass');
    $selectDB mysql_select_db('dbname');

    $insert mysql_query("INSERT INTO table (id, ipaddress, timestamp) VALUES (NULL, $_SERVER['REMOTE_ADDR'], time())");

    $close mysql_close($conn); 
    <?php include_once('signature'); ?>

  6. #6
    Join Date
    Jul 2002
    Location
    UK
    Posts
    2,026
    I think null's just about nailed it.

    An extension of that could be to make it query for past downloads from that IP and only allow one download per 5minutes, to stop download flooding (you'd want to check for X_FORWARDED_FOR in the $_SERVER global in case of transparent proxies such as the ones ntl: use)

    Or you could make it check that an entry for that IP exists - an entry is added after they fill in a short form... etc.
    Gone.

Posting Permissions

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