/ Published in: PHP
                    
                                        
Ever wanted to give your cliant an idear on how much disk space they have remaining?  The following script will tell your user how much disk space has been used and how much is remaining.  In this example $diskspace refers the amount of diskspace your cliant has avalable.  
The value of disk space can be changed to suite, if required this value can my connected to a mysql_query. Such as if you are running a hosting service, have the value pulled from your hosting database.
If you dont wish to include a /mb removed the "." MB / ". $diskspace" line 4
                The value of disk space can be changed to suite, if required this value can my connected to a mysql_query. Such as if you are running a hosting service, have the value pulled from your hosting database.
If you dont wish to include a /mb removed the "." MB / ". $diskspace" line 4
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?
$diskspace="30Mb";
$path = $_SERVER['DOCUMENT_ROOT'];
echo (filesize_r($path)/1048576)." MB / ". $diskspace;
function filesize_r($path){
$ret = 0;
$ret += filesize_r($fn);
return $ret;
}
?>
URL: http://www.scopesden.co.uk/code_get_feed.php?Content_ref=29
Comments
 Subscribe to comments
                    Subscribe to comments
                
                