blaze64

Well-Known Member
Feb 5, 2003
159
0
166
Has anyone found out the correct tag for bandwidth remaining? The
&cpanel print=&$CPDATA{'BWLIMIT'}&&

seems to work great but it displays bites....I would rather have MB.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
&SCRIPT&
f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576 / 1000;
document.write ( String(f) +& GIG& );
&/SCRIPT&

This works perfectly.
 

nieve

Registered
Jan 23, 2003
2
0
151
&SCRIPT&
f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
document.write ( String(f) +& MB& );
&/SCRIPT&
 

blaze64

Well-Known Member
Feb 5, 2003
159
0
166
That worked well also! Great!

Now, this tells displays how much bandwidth your account is allowed. Is there a way for it to show

1000 mb (per month)
200 mb (used already)
-------------------------
800 mb (amount left) &----- HOW DO YOU DISPLAY ONLY THIS?
 

nieve

Registered
Jan 23, 2003
2
0
151
&SCRIPT&
f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
g = f - &cpanel Stats=&countbandwidth()&&;
document.write ( String(g) +& MB& );
&/SCRIPT&
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Originally posted by nieve
&SCRIPT&
f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
g = f - &cpanel Stats=&countbandwidth()&&;
document.write ( String(g) +& MB& );
&/SCRIPT&
Can somebody please write this again how it should be or tell me whether the following is correct?

<script>
f = <cpanel print="$CPDATA{'BWLIMIT'}"> / 1048576;
g = f - <cpanel Stats="countbandwidth()">;
document.write ( String(g) +" MB" );
</script>
I'm not too good with coding....

---------------------
Edit: Got it working. That was it. I'm proud of myself.:)
 
Last edited:

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
By the way, you'll get a script error if the account has unlimited bandwidth. I just found that out. (It was my own account, so I just changed the limit).

cPanel.net Support Ticket Number: