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 : 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 Update Picture
Dark Knite
Date : Jan 05th 2000
Grade : 1 of 5 (graded 2 times)
Viewed : 24300
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Dark Knite
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<HTML><HEAD><TITLE>Dir View</TITLE></HEAD>
<BODY BGCOLOR="#000000" TEXT="#aaaaaa" LINK="#888888" VLINK="#444444">
<CENTER><h1>PHP Directory Viewer</h1>Made by Dark Knite<BR><HR></CENTER>
<BR>
<table align="center" cellpadding="0">
        <tr><TD> </DT><td>File Name</td><td>File Size</td><td>Description</td></tr>

<?php
// OK please don't hold it against me, I have stripped my original
//        down a lot ot make it easy for you to understand. But it can very
//        easyly be sooped but I'll leave that up to you. If you want to see
// this in action come to www.darkestknite.com and check it out.
//        The only reason i learned PHP is so I can create a directory index
//        viewer with a black background, if you know of another way PLEASE
//        let me know. It would save me time designing god knows what.
//
//        SECURITY:WATCH OUT BECAUSE IF THE QUERY_STRING IS ../../../..
//                THE PHP TAKES IT AS BACK ONE DIRECTORY, BACK ONE MORE
//                AND BACK ONE MORE YET, SO SOMEONE CAN GET TO THE ROOT
//                WITHOUT MUCH PROBLEM, SO DESIGN SOME KIND OF CONDITION
//                AGAINST IT BEFORE USING IT.
//

$temp                =        getenv( "QUERY_STRING");
$dir_name        =        "$temp";

if($dir_name == "") $dir_name = ".";
$handle=opendir($dir_name);

while ($file = readdir($handle)) {        // Extract dir content
$filelst = "$filelst,$file";// save into string
}
closedir($handle);//
$filelist = explode(",",$filelst); // Brake string up into array
sort($filelist);
// sort the array acendingly, I suggest you make your own sort because this one sux

for ($count=1;$count<count($filelist);$count++) {
print "<TR>";
$filename=$filelist[$count];
$file_path = "$dir_name/$filename";
$filesize = filesize($file_path);
// You can use another function to format this, but you get the idea.
if (is_file($file_path)) {
// fleBLK.gif is a small icon of a file (draw yourself one and use that or use anything you want)
echo "<TD><img src=fleBLK.gif height=20 width=24></TD>";
echo "<TD><A HREF=\" $dir_name/$filename\" > $filename </A></TD>";
echo "<TD>$filesize bytes</TD>";
// I suggest you change "File" to a function returning a better description or remove it
completely (make sure you take them all out though)
echo "<TD>File</TD>";
}
elseif(($filename != ".") && ($filename != "..")) {
// DirBLK.gif is a small icon of a folder (draw yourself one and use that or use anything you
want)
echo "<TD><img src=DirBLK.gif height=20 width=24></TD>";
echo "<TD><A HREF=\"$filename\" > $filename </A></TD>";
echo "<TD> dir </TD>";
// I suggest you change "Directory" to a function returning a better description or remove it
completely (make sure you take them all out though)
echo "<TD>Directory</TD>";
}
print "</TR>";
}
?>
</table>
<center><HR>Made by Dark Knite for www.darkestknite.com<BR></center>
</BODY>
</HTML>



Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML -
Categories : PHP, Directories, FTP, Filesystem, HTML and PHP
Handle multiple file upload
Categories : Complete Programs, Filesystem, PHP, HTML and PHP
Open directory and File download
Categories : PHP, Filesystem, Directories, HTML and PHP
GuestBook Light - a plug and play application for any website.
Categories : PHP, Complete Programs, Filesystem, Sessions
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
Finds files on your site, uses UNIX find command.
Categories : Complete Programs, Filesystem, PHP
Opening and formatting text files into HTML on the fly- or HTML from templates.
Categories : PHP, HTML and PHP, Filesystem
phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install.
Categories : PHP, Complete Programs, HTML and PHP, MySQL
a file explorer for the web, filesystem php php3 files dirs directories pictures files windows linux system list ls scripts
Categories : PHP, URLs, Directories, Filesystem
Disk Usage, uses UNIX du command.
Categories : Complete Programs, PHP, Filesystem
Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP
AITSH Statistics
Categories : Complete Programs, Databases, HTML and PHP, Sessions, PHP
phpHoo2 (Xhoo using php3/MySQL) is a Yahoo-like link directory. Much like the Open Directory Project (dmoz.org).
Categories : PHP, Complete Programs, Directories, MySQL, URLs
Extended Get File List Function
Categories : PHP, Filesystem, Search, Directories
Listing the 10 most recently updated files in a given dir by using last- modified variable and printing to html with link to the file
Categories : PHP, Directories, Filesystem