[PHP] Problem with is_file function on WinNT and apache HELP!

2001-07-13 Thread Antony Cleave

I am trying to dynamically generate an image gallery from a directory iof
images.
To do this I am using the following code

 while (false!==($file = readdir($handle)))
   {
 if ((is_file($file)))
 {
  echo .. Link info here
  }
   }
Only problem is that none of the files in the folder apper to be files
according to PHP
I tried using

if (!(is_dir($file))
This returns every entry in the folder bar . and ..
BUT it includes the all of the other directories in the directory.
As I need to check the file extension before I link to it this is a serious
problem as PHP crashes apache when trying to find the file extension of a
directory.

Any Ideas?

Thanks in advance
Antony Cleave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with is_file function on WinNT and apache HELP!

2001-07-13 Thread ReDucTor

http://www.evilwalrus.com/download_agree.php?codeEx=304 is a good example of
using directory handles, works in windows...
- Original Message -
From: Antony Cleave [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, July 14, 2001 1:17 AM
Subject: [PHP] Problem with is_file function on WinNT and apache HELP!


 I am trying to dynamically generate an image gallery from a directory iof
 images.
 To do this I am using the following code

  while (false!==($file = readdir($handle)))
{
  if ((is_file($file)))
  {
   echo .. Link info here
   }
}
 Only problem is that none of the files in the folder apper to be files
 according to PHP
 I tried using

 if (!(is_dir($file))
 This returns every entry in the folder bar . and ..
 BUT it includes the all of the other directories in the directory.
 As I need to check the file extension before I link to it this is a
serious
 problem as PHP crashes apache when trying to find the file extension of a
 directory.

 Any Ideas?

 Thanks in advance
 Antony Cleave



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]