|
|
|
#! /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>
|
|
| Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | 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 | | | Searches through a local INN server's discussions Categories : Search, Complete Programs, PHP | | | Parses HTTP_USER_AGENT so that you can customize your site to different browsers Categories : HTML, PHP, 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 | | | PHPCatalog Categories : Ecommerce, PHP, Complete Programs | | | GuestBook Light - a plug and play application for any website. Categories : PHP, Complete Programs, Filesystem, Sessions | | | A set of functions sitting on top of the abstraction layer that makes it a little easier to do SQL stuff. Documentation is within Categories : Databases, ODBC, Complete Programs, PHP | | | fforum fumanchi forum MySQL treestructure Categories : Complete Programs, PHP, MySQL | | | A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed. Categories : Date Time, PHP, Complete Programs, Calendar | | | Builds JavaScript that updates the contents of one selector based on another. Categories : HTML, Java Script, PHP, Complete Programs, General | | | 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 | | | Simple Mini Poll class library (SimPoll) Categories : PHP, PHP Classes, Databases, MySQL, Complete Programs | | | Browse a MySQL database & draw a tree view & load final items into a template page. Categories : MySQL, Complete Programs, Algorithms, PHP, Databases | |
|
|
|