Jump to content

[SOLVED] PHP Progress Bar - Disk Space Usage


hoopplaya4

Recommended Posts

Hi All,

 

One more question: I've tried searching the web for a progress bar that displays the percentage of disk space available, however, all I can find is progress bars for "uploading."

 

Do you know how I might either, a) create my own progress bar, or b) find one that's already been created?

 

I currently have the percentage calculated, i.e.

 

"You are using roughly 32% of your alloted disk space."

 

However, I'd like to display this in a visual way as well.

 

Thanks!

I would do it with simple XHTML and CSS. Example:

 

<?php
$percent = 32;
echo '<div style="position: relative; display: block; width: 100px; height: 5px; border: 1px solid #888888; background-color: #eeeeee;">
<div style="position: absolute; top: 0; left: 0; z-index: 0; width: ', $percent, 'px; height: 5px; background-color: #888888;"></div>
</div>';
?>

 

If you want it to be longer than 100 pixels, just manipulate $percent accordingly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.