Re: [PHP] read filenames from dir

2001-07-26 Thread Dr.Bob

Thanx Phil, workes great!

Dr.Bob

"Phil Spitler" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This should do it for you.
>
> 
> $path = "THE DIRECTORY YOU WISH TO LIST THE FILES FROM";
>
> $d = dir($path);
> while ($entry=$d->read()) {
>   if ((!is_dir($path.$entry)) AND ($entry !== ".") AND ($entry !== "..")){
> echo "$entry\n";
>   }
> }
> $d->close();
>
> ?>
>
> -
> Phil Spitler [Vice President]
> Web Hut Design, Inc.
> c 704-451-1324
> mailto:[EMAIL PROTECTED]
>
> > -Original Message-
> > From: news.php.net [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 26, 2001 9:20 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] read filenames from dir
> >
> >
> > hi,
> > I want to read the filenames in a specific dir (running Linux)
> > and echo the
> > names as link in my browser.
> > Which functions/commands can I use for this?
> > What are the security risks?
> >
> > TIA,
> > Dr.Bob
> >
> >
> >
> > --
> > 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]




RE: [PHP] read filenames from dir

2001-07-26 Thread Phil Spitler

This should do it for you.

read()) {
  if ((!is_dir($path.$entry)) AND ($entry !== ".") AND ($entry !== "..")){
echo "$entry\n";
  }
}
$d->close();

?>

-
Phil Spitler [Vice President]
Web Hut Design, Inc.
c 704-451-1324
mailto:[EMAIL PROTECTED] 

> -Original Message-
> From: news.php.net [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 26, 2001 9:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] read filenames from dir
> 
> 
> hi,
> I want to read the filenames in a specific dir (running Linux) 
> and echo the
> names as link in my browser.
> Which functions/commands can I use for this?
> What are the security risks?
> 
> TIA,
> Dr.Bob
> 
> 
> 
> -- 
> 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]