Jump to content

Search the Community

Showing results for tags 'hard disk space calculation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. need help on Monitoring Hard disk space on other computers on the network I already created a program to calculate my own HARD DISK My problem is when I try to code the other network computer my error was "access Denied" or "device not ready when the other Computer is OFF I have tried a software that can do it (Disk Monitor Pro) I cant Figure it out how to Make it work.. plss help. . P.S. I am newbie in php <html> <head> <?php /* get disk space free (in bytes) */ $df = disk_free_space("//Grahambelaperia/d"); $df2 = disk_free_space("Z:"); /* and get disk space total (in bytes) */ $dt = disk_total_space("//Grahambelaperia/d"); $dt2 = disk_total_space("Z:"); /* now we calculate the disk space used (in bytes) */ $du = $dt - $df; $du2 = $dt2 - $df2; /* percentage of disk used - this will be used to also set the width % of the progress bar */ $dp = sprintf('%.2f',($du / $dt) * 100); $dp2 = sprintf('%.2f',($du2 / $dt2) * 100); /* and we formate the size from bytes to MB, GB, etc. */ $df = formatSize($df); $du = formatSize($du); $dt = formatSize($dt); $df2 = formatSize($df2); $du2 = formatSize($du2); $dt2 = formatSize($dt2); function formatSize( $bytes ) { $types = array( 'B', 'KB', 'MB', 'GB', 'TB' ); for( $i = 0; $bytes >= 1024 && $i < ( count( $types ) -1 ); $bytes /=1024, $i++ ); return( round( $bytes, 2 ) . " " . $types[$i] ); } ?> <style type='text/css'> .progress { border: 2px solid #5E96E4; height: 32px; width: 540px; margin: 75px auto; } .progress .prgbar { background: Gold; width: <?php echo "$dp;" ?>%; position: relative; height: 32px; z-index: 999; } .progress .prgbar2 { background: Gold; width: <?php echo "$dp2;" ?>%; position: relative; height: 32px; z-index: 999; } .progress .prgtext { color: white; text-align: center; font-size: 15px; padding: 9px 0 0; width: 540px; position: absolute; z-index: 1000; } .progress .prginfo { margin: 3px 0; } </style> </head> <body bgcolor = "purple"> <div class='progress'> <div class='prgtext'><?php echo $dp; ?>% Disk Used of <?php echo " ".$dt; ?> </div> <div class='prgbar'></div> <div class='prginfo'> <span style='float: left;'><?php echo "Drive C:"; ?></br> <?php echo "$du used space of $dt"; ?></br> <?php echo "$df free space of $dt"; ?></br> </span> <span style='clear: both;'></span> </div> </div> <div class='progress'> <div class='prgtext'><?php echo $dp2; ?>% Disk Used of <?php echo " ".$dt2; ?> </div> <div class='prgbar2'></div> <div class='prginfo'> <span style='float: left;'><?php echo "Drive Z:"; ?></br> <?php echo "$du2 used space of $dt2"; ?></br> <?php echo "$df2 free space of $dt2"; ?></br> </span> <span style='clear: both;'></span> </div> </div> </body>
×
×
  • 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.