Anyone firmiliar with PHP?
#1
GTcars - Post God !
Thread Starter
Join Date: Sep 2003
Location: Macomb, Michigan
Posts: 6,032
Rep Power: 879
Anyone firmiliar with PHP?
I can't figure out why this won't work, I found it off of http://px.sklar.com/ and then tweaked it by adding the loop to display all the files in the array...
<?
/*
This script read the filenames from a specified directory and returns them in an array.
The number of filenames is also returned.
Copyleft(L) 1999 Eric Persson, eric@persson.tm, http://www.persson.tm/scripts/
*/
Function searchdir($basedir)
{
global $filelisting, $number;
unset($filelisting);
unset($number);
$handle=opendir($basedir);
while ($file = readdir($handle)) {
if ($file=="." or $file=="..") {
** else {
$filelisting[]="$basedir$file";
**;
**;
$number=sizeof($filelisting);
**;
searchdir("./");
for ($i = 0; $i <= $number; $i++) {
echo $filelisting[$i];
**
echo $number; //echos the size of the array
?>
but when I run this file on my image directory, it doesn't echo anything.
<?
/*
This script read the filenames from a specified directory and returns them in an array.
The number of filenames is also returned.
Copyleft(L) 1999 Eric Persson, eric@persson.tm, http://www.persson.tm/scripts/
*/
Function searchdir($basedir)
{
global $filelisting, $number;
unset($filelisting);
unset($number);
$handle=opendir($basedir);
while ($file = readdir($handle)) {
if ($file=="." or $file=="..") {
** else {
$filelisting[]="$basedir$file";
**;
**;
$number=sizeof($filelisting);
**;
searchdir("./");
for ($i = 0; $i <= $number; $i++) {
echo $filelisting[$i];
**
echo $number; //echos the size of the array
?>
but when I run this file on my image directory, it doesn't echo anything.
Thread
Thread Starter
Forum
Replies
Last Post
mz.pasillas_o7_27_07
honda / acura
0
11-08-2008 09:47 PM
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)