+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 16

Thread: cPanel Remote Bandwidth Script

  1. #1
    Administrator Brandon is an unknown quantity at this point Brandon's Avatar
    Join Date
    Jun 2006
    Location
    The ghetto aka Tbury, Massachusetts
    Posts
    8,260

    cPanel Remote Bandwidth Script

    Have you ever wanted to show how much bandwidth you have used?

    Well do I have a solution for you...the Brandon's cPanel Bandwidth Checker!!

    PHP Code:
    <?php

    /*############################
    Bandwidth From cPanel
    Brandon's cPanel Bandwidth Checker!!!
    Brandon, for x10 <brandon@x10hosting.com>
    Support Info: http://www.blnetworks.net/showthread.php?p=197#post197
    ############################*/

    // EDIT BELOW
    $username "username"// cPanel Username
    $password "password"// cPanel Password
    $domain "domain"// cPanel Domain
    $theme "x"// cPanel Theme



    // DO NOT EDIT THIS CODE
    ini_set("display_errors""0");
    $file file_get_contents("http://$username:$password@$domain:2082/frontend/$theme/index.html") or die("<b>Critical Error, Please check your configuration</b>");
    $string1 strpos($file"Bandwidth (this month)");
    $file substr($file,$string1);
    $string2 strpos($file"Megabytes");
    $length strlen($file);
    $take =  $length $string2;
    $finally substr($file,0,-$take);
    $number explode("<td class=\"index2\">"$finally);
    $number explode(" ",$number[1]);
    $bandwidth $number[0];


    // START EDITING
    /*
     $bandwith is now the amount of bandwith you have used!
    We are echoing it, but you can do whatever with it*/
    echo $bandwidth;

    ?>
    Edit the user name, password, domain, and theme...don't edit the do not edit unless you know what edits to edit!!!

    You can remove "echo $bandwidth;" if you like, and include this in any script and add $bandwidth to the script were you want.

    This was coded for an upcoming signature I am making, but I decided to release it.

    If you find a bug, or me, I will fix it and release a new update

    Also if you use it, i would appreciate a reply on how it works for you, maybe some rep, or just a thanks.
    Last edited by Brandon; 04-22-2007 at 05:04 PM.
    Thanks,
    Brandon, x10Hosting Administrator
    (97 571-9054

  2. #2
    Lord Of The Keys Zenax is an unknown quantity at this point Zenax's Avatar
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,311

    Re: cPanel Remote Bandwidth Script

    Quote Originally Posted by Brandon View Post
    Have you ever wanted to show how much bandwidth you have used?

    Well do I have a solution for you...the Brandon's cPanel Bandwidth Checker!!

    Edit the user name, password, domain, and theme...don't edit the do not edit unless you know what edits to edit!!!

    You can remove "echo $bandwidth;" if you like, and include this in any script and add $bandwidth to the script were you want.

    This was coded for an upcoming signature I am making, but I decided to release it.

    If you find a bug, or me, I will fix it and release a new update

    Also if you use it, i would appreciate a reply on how it works for you, maybe some rep, or just a thanks.

    The script can be modified to read any of the statistics. I managed to change it to read the amount of disk space that I had left! All you have to do is change the first bit in bold, to the text that appears on the left hand side of the table.

    Example

    PHP Code:
    $string1 strpos($file"Bandwidth (this month)"); 
    now becomes

    PHP Code:
    $string1 strpos($file"Disk space available"); 
    Notice the difference. It basically searchs that document for that piece of text, and then displays the value its worth.

    The way I figured it out was by changing the text, and then comparing the value I got to the one shown in cPanel and it honestly works!

    Nice script Brandon! A very good job well done!

    Regards,
    Zenax

    Edit: Sorry for the long length, ill remember in future. btw I gave you rep brandon!
    Last edited by Zenax; 04-23-2007 at 03:41 AM. Reason: removed script for size reasons.
    Regards,
    Zenax
    http://twebblog.wordpress.net - Soon to move to x10!

  3. #3
    Administrator Brandon is an unknown quantity at this point Brandon's Avatar
    Join Date
    Jun 2006
    Location
    The ghetto aka Tbury, Massachusetts
    Posts
    8,260

    Re: cPanel Remote Bandwidth Script

    I guess it could work like that, but i did math and stuff, it could still work though:>
    Thanks,
    Brandon, x10Hosting Administrator
    (97 571-9054

  4. #4
    Community Advocate Derek is an unknown quantity at this point
    Join Date
    May 2005
    Location
    cossacks
    Posts
    3,941

    Re: cPanel Remote Bandwidth Script

    Thanks for it i might use it for like attachments..
    -Derek
    Please Click If I helped you!
    Serving for x10 Since December 26, 2004
    Retired. Former Staff.(Account Manager)

  5. #5
    Administrator Brandon is an unknown quantity at this point Brandon's Avatar
    Join Date
    Jun 2006
    Location
    The ghetto aka Tbury, Massachusetts
    Posts
    8,260

    Re: cPanel Remote Bandwidth Script

    Quote Originally Posted by Derek View Post
    Thanks for it i might use it for like attachments..
    How, it checks your bandwidth or file space.
    Thanks,
    Brandon, x10Hosting Administrator
    (97 571-9054

  6. #6
    Community Advocate Derek is an unknown quantity at this point
    Join Date
    May 2005
    Location
    cossacks
    Posts
    3,941

    Re: cPanel Remote Bandwidth Script

    Yeah like i say Blah space blah used..
    -Derek
    Please Click If I helped you!
    Serving for x10 Since December 26, 2004
    Retired. Former Staff.(Account Manager)

  7. #7
    Lord Of The Keys Zenax is an unknown quantity at this point Zenax's Avatar
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,311

    Re: cPanel Remote Bandwidth Script

    The script would be useful for thing such as filehosting services like filevip.com as it could show how much space there is available etc?!?
    Regards,
    Zenax
    http://twebblog.wordpress.net - Soon to move to x10!

  8. #8
    Retired bigguy is an unknown quantity at this point bigguy's Avatar
    Join Date
    Mar 2005
    Location
    Canada
    Posts
    5,427

    Re: cPanel Remote Bandwidth Script

    Nice little snippet. I might give this a try, thanks.

  9. #9
    Community Advocate Derek is an unknown quantity at this point
    Join Date
    May 2005
    Location
    cossacks
    Posts
    3,941

    Re: cPanel Remote Bandwidth Script

    Yup thats what its for..
    -Derek
    Please Click If I helped you!
    Serving for x10 Since December 26, 2004
    Retired. Former Staff.(Account Manager)

  10. #10
    x10Hosting Member xai_master is an unknown quantity at this point
    Join Date
    Sep 2006
    Posts
    93

    Re: cPanel Remote Bandwidth Script

    thx for the script but why use script if cPanel can check bandwidth too ?

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Similar Threads

  1. [OFF] Script Instillations (Now Accepting)
    By kryptonyte in forum The Marketplace
    Replies: 0
    Last Post: 08-02-2006, 02:15 AM
  2. Server UP time Script
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-03-2006, 04:39 PM
  3. CGI - script, Advertisement _HELP.
    By kaliforna in forum Free Hosting
    Replies: 12
    Last Post: 06-02-2005, 06:01 AM
  4. digital.exofire.net | Support | problem#1 = " cPanel "
    By kaliforna in forum Free Hosting
    Replies: 10
    Last Post: 04-12-2005, 11:22 AM

Posting Permissions

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