05-26-2008, 08:25 AM
|
#5 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Peuplarchie
Here is where I am now :
PHP Code:
<?php
$imgdir= $_GET['folder'];
$imgdir.="/";
// dircont (string [directory path])
// Returns Array of filenames in the given directory.
// Returns FALSE on error.
function dircont($imgdir)
{
$dir_array = array();
if (false !== ($dir = opendir($imgdir)))
{
while (false !== ($file = readdir($dir)))
{
if ($file != '.' && $file != '..')
{
$dir_array[] = $file;
$contentArray[$file]['modifiedTime'] = filemtime($imgdir."".$file);
$my_image = array_values(getimagesize($imgdir."".$file));
list($width, $height, $type, $attr) = $my_image;
$widthArray[$file][filemtime($imgdir."".$file)]['orientation'] = $height;
}
}
return $widthArray;
}
}
// To print..
// $path = "/home/helpelf/helpelf-www/";
echo "<pre>";
print_r(dircont($imgdir));
echo "</pre>";
?>
|
You need to specify what $_GET['folder'] is, and since $_GET is specifically ONLY used for url vars, you would have to put in a custom url var to show the directory of files.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|