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 : List Directory Contents, uses UNIX ls command.
Categories : Complete Programs, PHP Click here to Update Your Picture
Marcus Xenakis
Date : Apr 29th 1999
Grade : Be the 1st to grade this Code Example
Viewed : 12216
File : directory.php
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><?php echo("$dir") ?> Directory List</TITLE>
</HEAD>

<BODY>
<b><font face=arial size=+2>
Directory List<br>
<?php passthru("du -ks $dir") ?>
</font></b>
<font face=arial>
<br><?php print(date("m/d/y h:i")) ?>
<hr>
<pre>
<?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 "ls" command. //
// It should reside in your web server root directory //
// //
// This program reads the directory based upon the //
// a passed paramter (parm) or the current directory //
// the program resides in if parm is null. //
// //
// This program is disigned to call two other php //
// scripts, //
// usage.php: which displays directory usage. //
// finder.php: which searches a site for files //
// //
// There are no modifications are required in order //
// to run this script. //
// //
// Driectories are displayed in blue. //
// MP3 files are displayed in red. //
// Click on a dir to call this program recursively. //
// Click on a file to display or download, depends on //
// file type. //
// //
// *****************************************************//

exec("ls -la $dir",$lines,$rc);
$count = count($lines) - 1;
for ($i = 1; $i <= $count; $i++) {
$type = substr($lines[$i],0,1);
$name = strrchr($lines[$i]," ");
$name = substr($name,1);
$dire = substr($lines[$i],0,strpos($lines[$i],$name));
if (strpos($name,".mp3")) {
echo "<font color=\"red\">";
} else {
if (strpos($name,".php") or strpos($name,".cgi")) {
echo "<font color=\"maroon\">";
} else {
if ($type == "d") {
echo "<font color=\"blue\">";
} else {
echo "<font color=\"black\">";
}
}
}
echo "$dire</font>";
if ($type == "d") {
if ($name == "." or $name == "..") {
echo "$name<br>";
} else {
if ($dir == "") {
echo "<a href=directory.php?dir=$name>$name</a><br>";
} else {
echo "<a href=directory.php?dir=$dir/$name>$name</a><br>";
}
}
} else {
if ($dir == "") {
echo "<a href=$name>$name</a><br>";
} else {
echo "<a href=$dir/$name>$name</a><br>";
}
}
}
?>
</pre>
<hr><br></font>
<font face=arial size=2>
[<u><a href=usage.php>Usage</a></u>]
[<u><a href=finder.php>Find</a></u>]
</font>

</body>
</html>



phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web.
Categories : Databases, MySQL, Complete Programs, PHP
This program will take data from a user via a web based form, validate it, show it to the user for re-validation, and finally insert it into the database. Plenty of sanity checking on the fields in the form.
Categories : MySQL, HTML and PHP, PHP, Complete Programs, Databases
Voting Machine with Access 97
Categories : PHP, ODBC, WinNT, MS Access, Complete Programs
Shopping Cart e-Commerce Solution
Categories : Complete Programs, PHP, MySQL, Databases
phpYellow Pages Standard
Categories : PHP, Complete Programs, Databases, Directories, Search
Parses HTTP_USER_AGENT so that you can customize your site to different browsers
Categories : HTML, PHP, Complete Programs
Monitor the files you provide for download! Track who downloads your files, and when.
Categories : PHP, Complete Programs, Utilities
bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
PHPRecommend v1.0 - Recommend this page to a friend script written in PHP. Easy to install
Categories : PHP, URLs, Complete Programs, Email, Site Planning
phpWebCam v1.0- Webcam management software - Automatically checks if you're online, and comes with a caption tool capable of handling multiple users.
Categories : PHP, Complete Programs, HTML and PHP
Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
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
phpAddQuote v1.2 - UPDATED! Lets users add their own quotes to your website. You specify how many quotes appear on the page at a time. Easier install!
Categories : HTML and PHP, Complete Programs, PHP, Databases, Personalization and Membership
AITSH Download
Categories : PHP, Complete Programs, MySQL, Databases
This is a script that list all image files on a given directory, and displays the thumbnails nicely formated within an HTML table. It also make use of JavScript to open pop up windows when the users want to see the full photo.
Categories : Graphics, PHP, Complete Programs, Java Script