Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: PHP Help and scripts (custom)

  1. #1
    chris218 is offline x10Hosting Member chris218 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    London, UK
    Posts
    65

    PHP Help and scripts (custom)

    I'm offering PHP help.

    I am pretty "fluent" in php, and have specialised knowledge in certain php software, for instance phpbb.

    If you need a bit of help, PM me, or reply to this topic.

    I can do pretty much anything within reason, modifcation on a script, or righting a whole new one

    Thanks

    Chris

    PS - this is slight duplicate to in Site Management

    IRC - #php-scripts on irc.freenode.net

    The topic indicates if i am avaible or not (I'm not ChanServ!)

  2. #2
    oscar.j4l is offline x10 Sophmore oscar.j4l is an unknown quantity at this point
    Join Date
    Jan 2005
    Location
    Oxnard, CA.
    Posts
    181

    Re: PHP Help and scripts (custom)

    i need a script that can keep track of bandwidth of a file... and stop the file from being downloaded once it's reached it's max bandwidth.

    idk. if you need a more clear explination.

  3. #3
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: PHP Help and scripts (custom)

    lol i already asked him about this, i believe he said he didn't know how to do it, but i'm sure he could make you a downloads system ;)
    -Chris Z
    Retired Account Manager


  4. #4
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: PHP Help and scripts (custom)

    Tracking bandwidth of a file is impossible through PHP without assistance of some server side application that would track outgoing transfer. In other words, impossible unless you actually own the server or have full shell access.

    The closest best thing would be a script that would count bandwidth based on clicks and file size. It will not be very accurate (because it would count bandwidth usage of full size of file each time link is clicked, even if user cancels download), but I could make it for you if you like.

  5. #5
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: PHP Help and scripts (custom)

    maybe bryon could make something like this or implement it into cPanel or something :dunno but that would be cool if this was available to members..
    -Chris Z
    Retired Account Manager


  6. #6
    Spartan Erik's Avatar
    Spartan Erik is offline Retired Spartan Erik is an unknown quantity at this point
    Join Date
    Aug 2005
    Posts
    3,382

    Re: PHP Help and scripts (custom)

    That's not a bad idea.. if you could make a stat meter of some sort for everyone that would be pretty cool..

  7. #7
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: PHP Help and scripts (custom)

    Quote Originally Posted by Torch
    Tracking bandwidth of a file is impossible through PHP without assistance of some server side application that would track outgoing transfer. In other words, impossible unless you actually own the server or have full shell access.

    ...
    Impossible? Naa... With a few if statements you could convert this function of mine from FileVIP to update a MySQL database table row with the current amount transferred, left to trans., total trans., etc etc.

    If you guys want to you could take a shot at it. I don't have time now to. ;)

    PHP Code:

    function sendDownload($file$speed) {
          
    $filename basename($file);
          
    $file_extension array_pop(explode('.'$filename));
          
    header("Pragma: public");
          
    header("Expires: 0");
          
    header("Cache-Control: private");
          
    header("Content-Type: application/octet-stream");
          
    header("Content-Disposition: attachment; filename=\"$filename\"");
          
    header("Accept-Ranges: bytes");
          
    $size filesize($file);  
          if(isset(
    $_SERVER['HTTP_RANGE'])) {
             
    $seek_range substr($_SERVER['HTTP_RANGE'], 6);
             
    $range explode'-'$seek_range);
             if(
    $range[0] > 0) { $seek_start intval($range[0]); }
             if(
    $range[1] > 0) { $seek_end  =  intval($range[1]); }
             
    header("HTTP/1.1 206 Partial Content");
             
    header("Content-Length: " . ($seek_end $seek_start 1));
             
    header("Content-Range: bytes $seek_start-$seek_end/$size");
          }
          else {
             
    $seekSeekSeek $seek_end $size;
             
    header("Content-Range: bytes 0-$seekSeekSeek");
             
    header("Content-Length: $size");
          }
          
    $fp fopen($file,'rb');
          
    fseek($fp,$seek_start);
          while(!
    feof($fp)) {
             
    set_time_limit(0);
             print(
    fread($fp, (1024 $speed)));
             
    flush();
             
    sleep(1);
          }
          
    fclose($fp);
          exit;
       } 
    Last edited by Bryon; 07-17-2006 at 08:54 PM.

  8. #8
    Chris Z's Avatar
    Chris Z is offline x10 Spammer Chris Z is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Alabama, USA
    Posts
    2,802

    Re: PHP Help and scripts (custom)

    hmm well unfortunatley i don't know how to do php with mysql db's and i wouldn't know what to change anyway lol, chris218, could you take a stab at this? and sorry for hijacking your thread...
    -Chris Z
    Retired Account Manager


  9. #9
    oscar.j4l is offline x10 Sophmore oscar.j4l is an unknown quantity at this point
    Join Date
    Jan 2005
    Location
    Oxnard, CA.
    Posts
    181

    Re: PHP Help and scripts (custom)

    well once you have it done... or if you can't have it done.. just PM me

  10. #10
    chris218 is offline x10Hosting Member chris218 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    London, UK
    Posts
    65

    Re: PHP Help and scripts (custom)

    I will take a look at bryon's code. I couldn't do it for you billy, as you wanted me to check via cpanel, and I couldn't find a thing on google.

    Since it is bryon's code, don't think its really right for me to charge for it, when all i do is convert. I could do it from scratch, but that would be pointless lol.

Closed Thread
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers