+ Reply to Thread
Results 1 to 3 of 3

Thread: Download Limit per IP

  1. #1
    nakaf's Avatar
    nakaf is offline Yes nakaf is WHB Lover!!!
    Join Date
    Aug 2006
    Posts
    59
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Download Limit per IP

    How r u doing all? Hope every thing is fine with u all

    As my topic Title I need any php Script that limits the download sessions by IP
    an Example:

    user with IP x.x.x.x just can download (1) file at the time
    I know there are too many scripts do it
    but really I need good script to do reduce our band/speed




    I think it will help some of our members here also
    [B]iN LoVe WiTh WHB[/B]:o

  2. #2
    PsyCHZZZ's Avatar
    PsyCHZZZ is offline aspiring dreamer~
    Join Date
    Dec 2006
    Location
    Tokyo, Japan.
    Posts
    142
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmmm... I'm not sure exactly what are your specific requirements but you can check out this site and see if any of their scripts will fit your specifications.

    Cheers~

  3. #3
    mouse is offline New Bee
    Join Date
    Nov 2006
    Posts
    6
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am not the best at PHP but I think this should be a simple problem. So here is what you need to do:
    1. You need to get the IP Address of everyone who downloads files
    2. You need to decide how often they can download (if it is once a day, or week, etc)
    3. You need to create a table to store the info (in this code it has 2 rows, ip & date)

    So it should look something like this:
    (When they download the file if it is once a day)
    $ip = $_SERVER['REMOTE_ADDR'];
    $date = date("mdy", time())
    mysql_query("INSERT INTO downloads (ip, date) VALUES ('$ip','$date')");


    (When checking)
    $ip = $_SERVER['REMOTE_ADDR'];
    $todaydate = date("mdy", time());
    $lastdownloaded = mysql_fetch_array(mysql_query("SELECT * FROM downloads WHERE ip='$ip'"));

    if($lastdownloaded[date] == $todaydate){
    echo "You already downloaded today";
    } else {
    *add download code here*
    }


    That should be able to work.

    ~Mouse

+ Reply to Thread

Posting Permissions

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