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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.