[PHP] opendir() Question

2009-06-12 Thread Parham Doustdar
Hi there, I need to create a PHP script that will connect to an FTP, get a listing of files/directories from it, and displays them in a table. Now, there is only one problem here. I tried connecting with opendir(), like this: opendir(ftp://...;); but it seems it doesn't work with FTP. Now, is

Re: [PHP] opendir() Question

2009-06-12 Thread Andrew Ballard
2009/6/12 Parham Doustdar parha...@gmail.com: Hi there, I need to create a PHP script that will connect to an  FTP, get a listing of files/directories from it, and displays them in a table. Now, there is only one problem here. I tried connecting with opendir(), like this:

Re: [PHP] opendir() Question

2009-06-12 Thread Parham Doustdar
Hello there Andrew, Thank you very much for your help. I didn't know such an extention existed. :) -- --- Contact info: Skype: parham-d MSN: fire_lizard16 at hotmail dot com email: parham90 at GMail dot com Andrew Ballard aball...@gmail.com wrote in message

Re: [PHP] Opendir on site root directory?

2009-03-11 Thread Stuart
2009/3/11 Clancy clanc...@cybec.com.au On Tue, 10 Mar 2009 15:12:57 +, stut...@gmail.com (Stuart) wrote: Please keep the discussion on-list. 2009/3/10 Clancy clanc...@cybec.com.au Hi, After I posted my message to the group today I realised that my program achieves its almost

Re: [PHP] Opendir on site root directory?

2009-03-10 Thread Stuart
2009/3/10 Clancy clanc...@cybec.com.au On Mon, 9 Mar 2009 10:07:33 +, stut...@gmail.com (Stuart) wrote: ... As in the example script I've posted above you can refer to the current working directory with a single period (.), but this is still relying on the current working directory

Re: [PHP] Opendir on site root directory?

2009-03-10 Thread Stuart
Please keep the discussion on-list. 2009/3/10 Clancy clanc...@cybec.com.au Hi, After I posted my message to the group today I realised that my program achieves its almost infinite flexibility by loading different include files in different circumstances, and from many different parts of

Re: [PHP] Opendir on site root directory?

2009-03-10 Thread Clancy
On Tue, 10 Mar 2009 15:12:57 +, stut...@gmail.com (Stuart) wrote: Please keep the discussion on-list. 2009/3/10 Clancy clanc...@cybec.com.au Hi, After I posted my message to the group today I realised that my program achieves its almost infinite flexibility by loading different include

Re: [PHP] Opendir on site root directory?

2009-03-09 Thread Stuart
2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 12:33:15 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 09:01:18 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au I want to index the files on

Re: [PHP] Opendir on site root directory?

2009-03-09 Thread Nathan Rixham
Stuart wrote: 2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 12:33:15 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 09:01:18 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au I want to index the

Re: [PHP] Opendir on site root directory?

2009-03-09 Thread Virgilio Quilario
I want to index the files on a website recursively. The program will run in the site root directory, which GETCWD reports as D:/Websites/Website_1.  I can open any file in the root directory simply using its file name; Joe.dat, for example, and I can opendir for any

Re: [PHP] Opendir on site root directory?

2009-03-09 Thread Clancy
On Mon, 9 Mar 2009 10:07:33 +, stut...@gmail.com (Stuart) wrote: ... As in the example script I've posted above you can refer to the current working directory with a single period (.), but this is still relying on the current working directory being what you expect it to be. Thank you!

Re: [PHP] Opendir on site root directory?

2009-03-09 Thread George Larson
but it had become lost in the detritus at the back of my mind Inappropriate as this is for _the_ PHP list -- that was a beautiful phrase, friend. On Mon, Mar 9, 2009 at 8:05 PM, Clancy clanc...@cybec.com.au wrote: On Mon, 9 Mar 2009 10:07:33 +, stut...@gmail.com (Stuart) wrote: ...

Re: [PHP] Opendir on site root directory?

2009-03-08 Thread Stuart
2009/3/8 Clancy clanc...@cybec.com.au I want to index the files on a website recursively. The program will run in the site root directory, which GETCWD reports as D:/Websites/Website_1. I can open any file in the root directory simply using its file name; Joe.dat, for example, and I can

Re: [PHP] Opendir on site root directory?

2009-03-08 Thread Clancy
On Sun, 8 Mar 2009 09:01:18 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au I want to index the files on a website recursively. The program will run in the site root directory, which GETCWD reports as D:/Websites/Website_1. I can open any file in the root

Re: [PHP] Opendir on site root directory?

2009-03-08 Thread Stuart
2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 09:01:18 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au I want to index the files on a website recursively. The program will run in the site root directory, which GETCWD reports as

Re: [PHP] Opendir on site root directory?

2009-03-08 Thread Clancy
On Sun, 8 Mar 2009 12:33:15 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au On Sun, 8 Mar 2009 09:01:18 +, stut...@gmail.com (Stuart) wrote: 2009/3/8 Clancy clanc...@cybec.com.au I want to index the files on a website recursively. The program will run

[PHP] Opendir on site root directory?

2009-03-07 Thread Clancy
I want to index the files on a website recursively. The program will run in the site root directory, which GETCWD reports as D:/Websites/Website_1. I can open any file in the root directory simply using its file name; Joe.dat, for example, and I can opendir for any subdirectory; eg

[PHP] opendir

2005-03-15 Thread Steve Buehler
So that I could use the opendir feature with an ftp url, I downloaded php-5.0.3 and used the following to make the cgi version: ./configure --enable-ftp make cp ./sapi/cgi/php /root Here is my script: start of script /root/z.php #!/root/php ?php if ($handle = opendir('ftp://login:[EMAIL

[PHP] opendir and IIS

2004-10-05 Thread ccma
Hi All, Currently Im battling a opendir on IIS(2003 server). The manual says to set your path to \\server\share\directory So i set it up $path=zice\\itdept\$\\Mis; Setting it that way results in: failed to open dir: Invalid argument error. tried reversing the slashes, same deal. tried via

Re: [PHP] opendir and IIS

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 10:22:56 -0500, ccma [EMAIL PROTECTED] wrote: Anyone know the exact phrasing that will work for me? I have r,w, directory browsing set on the shared servers dir for both the remote IIS machine name as well as the IWPG account of the remote machine. I fixed this issue

[PHP] opendir(), readdir() question..

2003-05-30 Thread ef
Hi all, How can i do for the moment i open and list all file there, display in the browser the order of this files by name ?. I have this code: ?php $handle=opendir('.'); while ($file = readdir($handle)) { if ($file != . $file != ..) { echo $file\n; } } closedir($handle); ? And

[PHP] Opendir listing

2003-02-20 Thread MIKE YRABEDRA
How do I remove the '.' and '..' from displaying with the following script? I want just the files, not the dots. ?php if ($handle = opendir('graphics/')) { echo Files:br\n; /* This is the correct way to loop over the directory. */ while (false !== ($file = readdir($handle))) {

Re: [PHP] Opendir listing

2003-02-20 Thread MIKE YRABEDRA
on 2/20/03 3:34 PM, MIKE YRABEDRA at [EMAIL PROTECTED] wrote: How do I remove the '.' and '..' from displaying with the following script? I want just the files, not the dots. ?php if ($handle = opendir('graphics/')) { echo Files:br\n; /* This is the correct way to loop over the

Re: [PHP] opendir security hole

2002-06-03 Thread Analysis Solutions
On Thu, May 23, 2002 at 11:23:42AM -0400, Analysis Solutions wrote: On Thu, May 23, 2002 at 11:22:28PM +1000, daniel wrote: dir=../../../../ it will show you the root dir of the server , how can i Before passing the $Dir variable to the file functions, clean it up... $Dir =

Re[2]: [PHP] opendir security hole

2002-06-03 Thread Stuart Dallas
On Monday, June 3, 2002 at 3:37:48 PM, you wrote: $dir = preg_replace('/\.\.\/?/', '', $dir); Surely a regular expression is overkill for this? It would be more efficient to use str_replace()... $dir = str_replace('..', '', $dir); -- Stuart -- PHP General Mailing List

Re: [PHP] opendir security hole

2002-06-03 Thread Analysis Solutions
On Mon, Jun 03, 2002 at 08:41:37PM +0100, Stuart Dallas wrote: Surely a regular expression is overkill for this? It would be more efficient to use str_replace()... $dir = str_replace('..', '', $dir); Sure. But you'd need to do two replaces. First for '../' then for '..' Not a big deal.

Re: [PHP] opendir security hole

2002-05-24 Thread daniel
unfortunatly it still happens Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thu, May 23, 2002 at 11:22:28PM +1000, daniel wrote: dir=../../../../ it will show you the root dir of the server , how can i Before passing the $Dir variable

Re: [PHP] opendir security hole

2002-05-24 Thread daniel
scuse my ignorance i had it after opendir, thanks for that Daniel [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... unfortunatly it still happens Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thu, May 23,

[PHP] opendir security hole

2002-05-23 Thread daniel
hi i am creating a webbased filemanager for uploading files to the database, to determin which dir i upload to i have the directory in the query string ie ?dir=blah , i have found a security flaw where if you type dir=../../../../ it will show you the root dir of the server , how can i lock into

Re: [PHP] opendir security hole

2002-05-23 Thread Analysis Solutions
On Thu, May 23, 2002 at 11:22:28PM +1000, daniel wrote: dir=../../../../ it will show you the root dir of the server , how can i Before passing the $Dir variable to the file functions, clean it up... $Dir = preg_replace('/..\//', '', $Dir); --Dan -- PHP classes that make

RE: [PHP] opendir security hole

2002-05-23 Thread Randy Wilcox
, 2002 9:22 AM To: [EMAIL PROTECTED] Subject: [PHP] opendir security hole hi i am creating a webbased filemanager for uploading files to the database, to determin which dir i upload to i have the directory in the query string ie ?dir=blah , i have found a security flaw where if you type dir

[PHP] OpenDir

2002-03-22 Thread José León Serna
Hello: I would like to use opendir to open a network resource \\myserver\myresource , I use IIS, I think I have to give the user of IIS permissions to log on that machine, but do you know how could I do it?. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] opendir problem on solaris

2002-03-08 Thread Nick selby
Hi, I've got a script that is installed on a Solaris machine that is having difficulties, and I'm wondering if anyone can help. The script is trying to access and read files within a directory, pull some at random and put them in a webpage. The path is correct, the directory is set to 755