i need a script to show all the files in a folder except one whiich that file name is processFiles.php
can anyone gimme that script plz?
can anyone gimme that script plz?
<?php
function DirOpen($dir = "./") {
if(!($dp = opendir($dir))) die("Cannot open $dir.");
while($file = readdir($dp)) $filenames[] = $file;
closedir($dp);
sort($filenames);
return $filenames
}
function Show($files) {
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Directory listing</title>
<style type="text/css" media="screen">
body {
background-color: #FFF;
color: #000;
font-family: Geneva, Arial, sans-serif;
font-size: 100%;
line-height: 140%;
}
a {
text-decoration: none;
}
a:hover {
text-decoration:none;
color: red;
}
.grey1 { background-color: #CCC; }
.grey2 { background-color: #DDD; }
</style>
</head>
<body>
<table border="0" cellspacing="2" cellpadding="2">
';
//Show's Folders
echo "<tr><th>Folders</th></tr>\n";
for($i=0; $i < count($filenames); $i++) {
if (is_dir($filenames[$i]) && !preg_match('/^\./',$filenames[$i]))
//do show directories but not files and exclude everything that starts with a dot
if(preg_match('/^\~/',$filenames[$i])) {
$name = substr($filenames[$i], 1);
echo "<tr><td><a href=\"" . rawurlencode($filenames[$i]) . "\">". $name . "</a></td></tr>\n";
}
}
//Show's Files
echo "<tr><th>Files</th></tr>\n";
for($i=0; $i < count($filenames); $i++) {
if(!preg_match('/^\./',$filenames[$i]) && !is_dir($filenames[$i]))
// don't show directories, listing.php and files that start with a dot
//Don't show somefile.php
if($filenames[$i] == "somefile.php")
unset($filenames[$i]);
echo "<tr><td><a href=\"" . rawurlencode($filenames[$i]) . "\">". wordwrap($filenames[$i], 60) . "</a></td></tr>\n";
}
echo "
</table>
</body>
</html>
";
}
Show(DirOpen("directory/"))
?>
<?
//define the path as relative
$path = "/home/yoursite/public_html/whatever";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "Directory Listing of $path<br/>";
//running the while loop
while ($file = readdir($dir_handle))
{
//I've also left out the current dir and parent dir "file"
if($file!="." && $file!=".." && $file!="processFiles.php") echo "<a href='$file'>$file</a><br/>";
}
//closing the directory
closedir($dir_handle);
?>
//define the path as relative
$path = "files";
//define the path as relative
$path = "/files/";
if($filenames[$i] == "processFiles.php")
Comment