[PHP] alphabetical filenames with readdir

2008-08-25 Thread Ed Curtis
Is there a way to make readdir output filenames alphabetically? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] alphabetical filenames with readdir

2008-08-25 Thread Ed Curtis
Ed Curtis wrote: Is there a way to make readdir output filenames alphabetically? Thanks, Ed Never mind. I figured out how to do it using an array and sort. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] alphabetical filenames with readdir

2008-08-25 Thread tedd
At 10:45 AM -0400 8/25/08, Ed Curtis wrote: Is there a way to make readdir output filenames alphabetically? Thanks, Ed Sure -- put the results in an array and then sort() or natsort() it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-04-03 Thread Rahul Sitaram Johari
Ave, I understand what you're saying, and logically I guess I need to validate $F and verify if it contains a concoction of what I want to be publicly accessible, and nothing else. Is there any other suggestions you can provide in helping secure this flaw?

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Rahul Sitaram Johari
Ave, This Works!!! ?php foreach (glob(vox/.$row['PHONE'].*.vox) as $value) { echo OPTION VALUE='takekey_download.php?F=vox/.basename($value).'.basename($value). /option; } ? Dug up glob() in the manual, followed examples and details ­ works like a charm! Full code:

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Jochem Maas
Rahul Sitaram Johari wrote: Ave, ... VALUE='takekey_download.php?F=vox/.basename($value).'.basename($value). show us the code for takekey_download.php, we may be able to save you on a major security issue with regard to the way you use the F get parameter. /option; } ?

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Tijnema !
On 3/30/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote: Ave, This Works!!! ?php foreach (glob(vox/.$row['PHONE'].*.vox) as $value) { echo OPTION VALUE='takekey_download.php?F=vox/.basename($value).'.basename($value). /option; } ? Dug up glob() in the manual, followed examples

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Rahul Sitaram Johari
Tijnema, In fact this same Question popped into my head - which one should I choose and why to choose one over the other? I tried both of the codes and compared them. While I can't comment on any security benefits of using either, I have to say, I did find glob() to be slightly faster in

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Rahul Sitaram Johari
Ave, You will probably find this code pretty inefficient, although it works flawlessly, but I ran into a problem with Internet Explorer 7, which instead of giving the Save as dialog box, tried opening the file within the Internet Explorer 7 window and displayed millions of bizarre characters on

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Tijnema !
On 3/30/07, Rahul Sitaram Johari [EMAIL PROTECTED] wrote: Ave, You will probably find this code pretty inefficient, although it works flawlessly, but I ran into a problem with Internet Explorer 7, which instead of giving the Save as dialog box, tried opening the file within the Internet

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Jochem Maas
Rahul Sitaram Johari wrote: Ave, You will probably find this code pretty inefficient, although it works flawlessly, but I ran into a problem with Internet Explorer 7, which instead of giving the Save as dialog box, tried opening the file within the Internet Explorer 7 window and displayed

Re: [PHP] Show filenames using Wildcards -- The glob() Solution!

2007-03-30 Thread Rahul Sitaram Johari
Ave, I'll add the Checking stuff immediately - I guess that was really just laziness on my part to get the job done. I'll make sure he's being a good dog and behaving himself ;) Will definitely get rid of '@'. Still not sure, as Tijnema pointed, if this is the most secure way to do this. I'm

[PHP] readdir filenames with accents issue

2006-09-08 Thread All U Want
Hi, I'm creating a file browsing site but don't know how to list properly filenames containing accents (french, spanish, etc). I've been browsing the archives but couldn't find a fix. foreach ($files as $file) { echo $file; } For example: Filename: sábado-1.mov

Re: [PHP] duplicate filenames but different .extention

2005-12-19 Thread Dragan Stanojevic - Nevidljivi
matt VanDeWalle wrote: hello again I am trying to figure out how i can read the list of files in a directory using the opendir() and readdir() functions. Normally this goes fine but within the loop, what i am wanting to do is echo the filename if it is a jpg file, but if its a .gif, just

[PHP] duplicate filenames but different .extention

2005-12-18 Thread matt VanDeWalle
hello again I am trying to figure out how i can read the list of files in a directory using the opendir() and readdir() functions. Normally this goes fine but within the loop, what i am wanting to do is echo the filename if it is a jpg file, but if its a .gif, just continue. I have several

Re: [PHP] duplicate filenames but different .extention

2005-12-18 Thread Curt Zirzow
On Sun, Dec 18, 2005 at 05:12:33PM -0600, matt VanDeWalle wrote: hello again I am trying to figure out how i can read the list of files in a directory using the opendir() and readdir() functions. Normally this goes fine but within the loop, what i am wanting to do is echo the filename if it

Re: [PHP] duplicate filenames but different .extention

2005-12-18 Thread Philip Hallstrom
hello again I am trying to figure out how i can read the list of files in a directory using the opendir() and readdir() functions. Normally this goes fine but within the loop, what i am wanting to do is echo the filename if it is a jpg file, but if its a .gif, just continue. I have several

[PHP] getting filenames from dir

2005-04-01 Thread Merlin
Hi there, does anybody know how to get all file names from a specified directory into an array? Thanx, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] getting filenames from dir

2005-04-01 Thread Jesper Goos
Try this function: function scandir($dirstr){ $files = array(); $fh = opendir($dirstr); while (false !== ($filename = readdir($fh))){ array_push($files, $filename);} closedir($fh); return $files; } return an array with all

RE: [PHP] getting filenames from dir

2005-04-01 Thread Stanislav Kuhn
))) { if ($file != . $file != ..) { echo $file\n; } } closedir($handle); } ? -Original Message- From: Merlin [mailto:[EMAIL PROTECTED] Sent: 01 April 2005 12:32 To: php-general@lists.php.net Subject: [PHP] getting filenames from dir Hi there, does

Re: [PHP] getting filenames from dir

2005-04-01 Thread Vaibhav Sibal
Message- From: Merlin [mailto:[EMAIL PROTECTED] Sent: 01 April 2005 12:32 To: php-general@lists.php.net Subject: [PHP] getting filenames from dir Hi there, does anybody know how to get all file names from a specified directory into an array? Thanx, Merlin -- PHP General

Re: [PHP] getting filenames from dir

2005-04-01 Thread Mario St-Gelais
That should get you started : $dirname='/var'; $dh=opendir($dirname) or die('could not open directory'); while (!(($file=readdir($dh))===false)){ if (is_dir('$dirname/$file')){ $myarray[]=$file; } echo $filebr; $myarray[]=$file; } Mario Merlin wrote: Hi there, does anybody know

Re: [PHP] + in filenames

2003-02-03 Thread Marek Kilimajer
That double quote is escaped [EMAIL PROTECTED] wrote: On Fri, 31 Jan 2003, Marek Kilimajer wrote: I use this: $name=strtr( $name, ?*#$%^:+=/\, __); I'm hoping that double quote was a typo?? Ed -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] + in filenames

2003-02-03 Thread ed
I'll be the first to admit I was wrong and missed that. This will work out great for me. I'm writting scripts for Realtors to upload photos to us via the web and you can only imagine what these people will include in a filename. Ed On Mon, 3 Feb 2003, Marek Kilimajer wrote: That double

Re: [PHP] + in filenames

2003-01-31 Thread Marek Kilimajer
that has the + character in it's name. - Vic -Original Message- From: Richard Whitney [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 5:32 PM To: Victor Cc: [EMAIL PROTECTED] Subject: RE: [PHP] + in filenames Victor! What are you trying to accomplish? Do you want to preserve

Re: [PHP] + in filenames

2003-01-31 Thread ed
On Fri, 31 Jan 2003, Marek Kilimajer wrote: I use this: $name=strtr( $name, ?*#$%^:+=/\, __); I'm hoping that double quote was a typo?? Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] + in filenames

2003-01-25 Thread Victor
I have a file upload field, and some filename checking code, but it breaks the code whenever a + is inside the filename it verifies space and other tags but breaks on + in the name. Anyone know a fix for this please? - Vic __

Re: [PHP] + in filenames

2003-01-25 Thread Richard Whitney
Some sample code would help, but maybe try urldecode('$filename'); RW Quoting Victor [EMAIL PROTECTED]: ### I have a file upload field, and some filename checking code, but it ### breaks the code whenever a + is inside the filename it verifies space ### and other tags but breaks on + in the

RE: [PHP] + in filenames

2003-01-25 Thread Victor
, 2003 5:12 PM To: Victor Cc: [EMAIL PROTECTED] Subject: Re: [PHP] + in filenames Some sample code would help, but maybe try urldecode('$filename'); RW Quoting Victor [EMAIL PROTECTED]: ### I have a file upload field, and some filename checking code, but it ### breaks the code whenever a + is inside

RE: [PHP] + in filenames

2003-01-25 Thread Richard Whitney
: Saturday, January 25, 2003 5:12 PM ### To: Victor ### Cc: [EMAIL PROTECTED] ### Subject: Re: [PHP] + in filenames ### ### Some sample code would help, but maybe try urldecode('$filename'); ### ### RW ### ### Quoting Victor [EMAIL PROTECTED]: ### ### ### I have a file upload field, and some

RE: [PHP] + in filenames

2003-01-25 Thread Victor
: Richard Whitney [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 5:32 PM To: Victor Cc: [EMAIL PROTECTED] Subject: RE: [PHP] + in filenames Victor! What are you trying to accomplish? Do you want to preserve the original filename? Why not give uploaded files uniformly unique names? In other

[PHP] Hiding Filenames

2001-12-21 Thread Matias Banzas
Hiow can i do 2 hide the real Filename / Url of a file? Ive seen it donde in lots of places... i need this 2 show some images and hide the real Location of them Anyone can help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

[PHP] Re: Filenames with spaces in them

2001-12-14 Thread Mike Eheler
I'll note that the erroneous command is the is_dir($file).. this causes the problem. Mike Mike Eheler wrote: Consider this code for traversing through a directory structure: ?php function traverse($path='.') { $path = realpath($path); $dir = opendir($path); echo \nDirectory

[PHP] Re: Filenames with spaces in them

2001-12-14 Thread Mike Eheler
Ahh forget it .. I figured it out change to is_dir($path/$file).. *smack* ignore this altogether mike Mike Eheler wrote: Consider this code for traversing through a directory structure: ?php function traverse($path='.') { $path = realpath($path); $dir = opendir($path); echo

RE: [PHP] read filenames from dir

2001-07-26 Thread Phil Spitler
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

[PHP] sorting filenames using opendir and readdir

2001-04-28 Thread Johannes Rumpf
Hi! I wanted to get a txt files in a dircetory, I wrote the script using opendir and readdir functions. But now I would like to sort the files while I read them in. how could I solve this problem? Greetings, Johannes Rumpf -- PHP General Mailing List

RE: [PHP] sorting filenames using opendir and readdir

2001-04-28 Thread Taylor, Stewart
more files { get file name $arrFilenames[] = $filename; } $arrFilenames = array_sort($arrFilenames); -Stewart; -Original Message- From: Johannes Rumpf [mailto:[EMAIL PROTECTED]] Sent: 28 April 2001 13:43 To: [EMAIL PROTECTED] Subject: [PHP] sorting filenames using opendir