WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Disk Usage, uses UNIX du command.
Categories : Complete Programs, PHP, Filesystem Click here to Update Your Picture
Marcus Xenakis
Date : Apr 29th 1999
Grade : 1 of 5 (graded 1 times)
Viewed : 28152
File : usage.tar
Images : No Images for this code example.
Search : More code by Marcus Xenakis
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

#! /usr/bin/php
<HTML>
<HEAD>
<TITLE>Disk Usage</TITLE>
</HEAD>

<BODY>
<b><font face=ariale1 size=+2>Disk Usage</font></b>

<!--- start PHP code ---->
<?php
// *****************************************************//
// //
// Author - Marcus S. Xenakis 4/28/99 //
// marcus@xenakis.net //
// //
// This simple PHP script only runs on a UNIX server. //
// It is based on the "du" and "ls" commands. //
// It should reside in your web server root directory //
// //
// This program reads the server root directory and //
// displays total disk usage for each subdirectory. //
// It also will display any MP3 files found on the site //
// which is a violation of TOS for many Web Hosts. //
// This program is disigned to call two other php //
// scripts, //
// directory.php: which displays directories //
// finder.php: which searches a site for files //
// //
// There are two lines that must be modified in order //
// to run. $home and your server root. //
// //
// Clicking on the folder image calls a directory list. //
// //
// *****************************************************//

// Set $home to your home directory on the server.
// MODIFY THE NEXT LINE FOR YOUR SITE
$home = "/home/yourdirectory";

echo "<font face=arial><br>";
print(date("m/d/y h:i"));
echo "<br>";


// The following code searches the entire site for MP3 files
echo "<!---- list any mp3s found in bold red ---->";
echo "<font color=\"red\"><pre>";
passthru("find $home -name '*.mp3' ");
echo "</pre></font>";

// Load subdirectories and load them into an array.
// note "/public_html" is appended to $home to identify the server root.
// MODIFY THE NEXT LINE FOR YOUR SITE
exec("ls -la $home/public_html",$lines,$rc);
$count = count($lines) - 1;
for ($i = 1; $i <= $count; $i++) {
$type = substr($lines[$i],0,1);
if ($type == "d") {
$dir[] = substr(strrchr($lines[$i]," "),1);
}
}
$count = count($dir) -1;

// list usage for directories found.
echo "<hr><br>";
for ($i = 0; $i <= $count; $i++) {
unset($du);
exec("du -ks $dir[$i]",$du,$rc);
echo "<a href=directory.php?dir=$dir[$i]>";
echo "<img src=\"folder.gif\" border=0></a>";
echo " $du[0]<br>";
}

?>
<!--- The following are links related utilities >
<hr><br></font>
<font face=arial size=2>
[<u><a href=directory.php>Dir</a></u>]
[<u><a href=finder.php>Find</a></u>]
</font>

</body>
</html>



Finds files on your site, uses UNIX find command.
Categories : Complete Programs, Filesystem, PHP
Handle multiple file upload
Categories : Complete Programs, Filesystem, PHP, HTML and PHP
Directory viewer, customize how you display the file structure, easy to understand. Found out about PHP 3 days ago, and this is my first prog.
Categories : HTML and PHP, Complete Programs, Directories, Filesystem, PHP
This is a simple photo gallery that reads the image files from multiple directories, and generates a web page styled with CSS1. It opens single auto window to view and print a given image.
Categories : Graphics, Filesystem, PHP, Complete Programs
QTO File Manager
Categories : Filesystem, filePro, Complete Programs, PHP, Content Management
Complete NotePad application for Websites (Like Yahoo Notepad)
Categories : PHP, Web Applications, Filesystem, Java Script, Complete Programs
File Explorer, browse, upload, download and edit your web site files with only a browser and a HTTP connection.
Categories : Complete Programs, Content Management, Filesystem, PHP
GuestBook Light - a plug and play application for any website.
Categories : PHP, Complete Programs, Filesystem, Sessions
Contents Page - a script to build contents pages.
Categories : Complete Programs, PHP, Utilities, Filesystem
simple shopping cart for php3
Categories : PHP, PHP Classes, Complete Programs, Ecommerce
filesystem Show Files Script
Categories : PHP, Filesystem, Java Script
phpAds, a complete banner and ad management system with detailled tracking and stats.
Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases
Point and Click Interface ala MS Access for creating SQL statements.
Categories : MySQL, Complete Programs, General SQL, PHP, Databases
Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
php Free chat simple fast and customizable chat server that uses a simple filesystem for message and nickname storage
Categories : PHP, AJAX, XML, Complete Programs