WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
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
Submit Site
Forex Trading Online forex trading platform

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 : 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 Update Picture
Laroche David
Date : Jan 20th 2000
Grade : 3 of 5 (graded 14 times)
Viewed : 20644
File : pics.zip
Images : No Images for this code example.
Search : More code by Laroche David
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

This script can be used when you have, for examples, a huge list of mp3's
which you want to list in a table without having to write them in. This script
can be used in linux and win32. It's a file explorer for the web.

<html>

<head>
<title>Web Development Luxembourg</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#006090" alink="#006090" vlink="#006699">

<font face="Arial" size="5" color="#006090"><center><b>Web Development Luxembourg -
phpDir v2.4</b></center><br></font>

<table align="center" cellpadding="0" cellspacing="0" border="0">

<tr>
<td height="25" bgcolor="#006699"><img src="space.gif"></td>
<td width="400" height="25" bgcolor="#006699" valign="middle"><b><font face="Arial"
size="2" color="#ffffff"> File Name </font></b></td>
<td width="100" height="25" bgcolor="#006699" valign="middle"><b><font face="Arial"
size="2" color="#ffffff"> File Size </font></b></td>
<td height="25" bgcolor="#006699"><img src="space.gif"></td>
</tr>

<font face="Arial" size="1">

<?php

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

if($dir_name == "") $dir_name = "d:/downloads";
$handle=opendir($dir_name);

while ($file = readdir($handle)) {
$filelst = "$filelst,$file";
}
closedir($handle);
$filelist = explode(",",$filelst);
sort($filelist);

for ($count=1;$count<count($filelist);$count++) {
print " <tr>\n";
$filename=$filelist[$count];
$file_path = "$dir_name/$filename";
$filesize = filesize($file_path);
if (is_file($file_path)) {
echo " <td height=\"25\" bgcolor=\"#006699\"><img src=\"space.gif\"></td>\n";
echo " <td width=\"400\" height=\"25\" valign=\"middle\"><font face=\"Arial\" size=\"2
\"> <a href=\"$dir_name/$filename\"><img src=\"f.gif\" width=\"20\" height=\"20\"
border=\"0\"></a> <a href=\"$dir_name/$filename\">$filename</font></a></td>\n";
echo " <td width=\"100\" height=\"25\" valign=\"middle\"><font face=\"Arial\" size=\"2
\"> $filesize bytes </font></td>\n";
echo " <td height=\"25\" bgcolor=\"#006699\"><img src=\"space.gif\"></td>\n";
}
elseif(($filename != ".") && ($filename != "..")) {
echo " <td height=\"25\" bgcolor=\"#006699\"><img src=\"space.gif\"></td>\n";
echo " <td width=\"400\" height=\"25\" valign=\"middle\"><font face=\"Arial\" size=\"2
\"> <a href=\"$dir_name/$filename\"><img src=\"o.gif\" width=\"20\" height=\"20\"
border=\"0\"></a> <a href=\"$dir_name/$filename\">$filename</font></a></td>\n";
echo " <td width=\"100\" height=\"25\" valign=\"middle\"><font face=\"Arial\" size=\"2
\"> <DIR> </font></td>\n";
echo " <td height=\"25\" bgcolor=\"#006699\"><img src=\"space.gif\"></td>\n";
}
print " </tr>\n\n";
}
?>
</font>

<tr>
<td colspan="4" bgcolor="#006699"></td>
</tr>

</table>

<p align=center>
<font face="Arial" size="1">
All Content is © 1999, <a href="http://www.webdev.lu/">Web Development
Luxembourg</a>.<br>
Created and Designed by <a href="mailto:laroche@webdev.lu">Laroche David</a>.
</font>
</p>

</body>
</html>



Display list of files within current and subdirectories (recursively) showing each file as an anchored link and each directory as a category header.
Categories : Filesystem, Directories, Arrays, PHP
php jump urls...the best way
Categories : PHP, URLs, Filesystem
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
grab directory listings into an array the example prints out each subdirectory in the main dir - further work is to be performed on this one
Categories : Filesystem, PHP, Directories, Search, Utilities
A function which places the path and name of all subdirectories into an array
Categories : PHP, Filesystem, Arrays, Directories
PHP4 DirectoryIterator Class
Categories : PHP, PHP Classes, Filesystem, Directories
Directory Viewer, Directory Content Viewer, Directory Structure to HTML. This code will basically create a complete set of HTMLs to let a user navigate through any directory you want. Excellent code for large file sharing pages.
Categories : Directories, Filesystem, PHP
List the content of the directory of your webserver where this small PHP Script resides.
Categories : PHP, Filesystem, Directories, CSS
getDirArray(Path,Filter,Sorted): Returns an array of the files in a directory, filtered by regular expression and either sorted or randomized. Good for random pictures and graphics.
Categories : PHP, Filesystem, Directories
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
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
Open directory and File download
Categories : PHP, Filesystem, Directories, HTML and PHP
Directory TreeView - File Manager & Explorer - FTP - Utility - PHP/HTML -
Categories : PHP, Directories, FTP, Filesystem, HTML and PHP
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
 Lubrobato Marco wrote :194
That a realy good script, because we can use it in linux 
and also in win32. Because I have got a huge list of 
documents which I don`t want to write in  a mysql 
database or html, because everyday there are 
documents which have to delete or some othere are 
new created. Thank you ...