> -Original Message-
> From: Luke [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 12, 2008 7:13 AM
> To: Jochem Maas
> Cc: [EMAIL PROTECTED]; php-general@lists.php.net
> Subject: Re: [PHP] Readdir() question
>
> Ok,
>
> one folder on your webserver, and
Luke wrote:
Ok,
one folder on your webserver, and put all of the files that you want to
include on your website/system in this folder (also uploading into this
folder); just in the root of that folder, so say you wouldn't have anymore
folders under it.
Make a table called 'Files,' containing:
Ok,
one folder on your webserver, and put all of the files that you want to
include on your website/system in this folder (also uploading into this
folder); just in the root of that folder, so say you wouldn't have anymore
folders under it.
Make a table called 'Files,' containing:
ID
Name
Type
t
Luke schreef:
When I need to do 'filesystem' type things I use MySQL to map all of the
files. This offers lot's of versatility in that you could just make a single
folder called filesystem and have all of your files in the root of that
folder - then use mysql to map virtual folders and structures
When I need to do 'filesystem' type things I use MySQL to map all of the
files. This offers lot's of versatility in that you could just make a single
folder called filesystem and have all of your files in the root of that
folder - then use mysql to map virtual folders and structures and such.
2008
Nathan Rixham schreef:
Jochem Maas wrote:
Nathan Rixham schreef:
Stut wrote:
maybe this is into coding standards and ethics.. but this may be
acceptable:
if( !defined('__DIR__') ) {
define('__DIR__' , dirname(__FILE__));
}
however realistically you'd have to do this in every file and nto
Jochem Maas wrote:
Nathan Rixham schreef:
Stut wrote:
maybe this is into coding standards and ethics.. but this may be
acceptable:
if( !defined('__DIR__') ) {
define('__DIR__' , dirname(__FILE__));
}
however realistically you'd have to do this in every file and nto just
in one include
wh
Nathan Rixham schreef:
Stut wrote:
On 11 Sep 2008, at 13:12, Ben Stones wrote:
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to
loop
all the files on the same directory and to tell PHP read the same
dire
Stut wrote:
On 11 Sep 2008, at 13:12, Ben Stones wrote:
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same
directory,
I think I'd need t
Ben Stones schreef:
Hi,
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think
[snip]
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to
loop
all the files on the same directory and to tell PHP read the same
directory,
I think I'd need to use the magic constant I think its called, __DIR__
On 11 Sep 2008, at 13:12, Ben Stones wrote:
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want
to loop
all the files on the same directory and to tell PHP read the same
directory,
I think I'd need to use the
Hi,
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think its called, __DIR__ su
."/*/{*.gif,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png}",
>> GLOB_BRACE) as $filename){
>> >$pics[]=$filename;
>> >}
>> >
>> > vincent
>> > -Original Message-
>> > From: Jochem Maas [mailto:[
.gif,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png}", GLOB_BRACE)
as $filename){
>$pics[]=$filename;
>}
>
> vincent
> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED]
> Sent: Tue 28/11/2006 10:59
> To: Tom Chubb
> Cc: [php] PHP
, GLOB_BRACE) as
$filename){
$pics[]=$filename;
}
vincent
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Tue 28/11/2006 10:59
To: Tom Chubb
Cc: [php] PHP General List
Subject: Re: [PHP] Readdir
Tom Chubb wrote:
> What would be the b
ochem Maas [mailto:[EMAIL PROTECTED]
Sent: Tue 28/11/2006 10:59
To: Tom Chubb
Cc: [php] PHP General List
Subject: Re: [PHP] Readdir
Tom Chubb wrote:
> What would be the best way to retrieve a list of files from an upload
> folder that are called "id" where the extension could be .doc .t
something like this?
while ( gettype ( $file = @readdir (@opendir ( $dirname )) ) != boolean ){
check if correct extension, else -> something completely else?
}
On Tuesday 28 November 2006 09:55, Tom Chubb wrote:
> What would be the best way to retrieve a list of files from an upload
> fo
Tom Chubb wrote:
> What would be the best way to retrieve a list of files from an upload
> folder that are called "id" where the extension could be .doc .txt or
> .pdf
> For example, I have a folder where people can upload a document and
> the document is renamed as their user id. They can upload a
If you are working in pure PHP5 OOP, you could like to try the new SPL
iterators.
see http://www.phpro.org/tutorials/Introduction-to-SPL.html#12
vincent
-Original Message-
From: Tom Chubb [mailto:[EMAIL PROTECTED]
Sent: Tue 28/11/2006 9:55
To: [php] PHP General List
Subject: [PHP
What would be the best way to retrieve a list of files from an upload
folder that are called "id" where the extension could be .doc .txt or
.pdf
For example, I have a folder where people can upload a document and
the document is renamed as their user id. They can upload a PDF, DOC
or TXT file. The
On Friday 15 September 2006 14:18, Toby Osbourn wrote:
> I suppose my question put simply is, what is the default ordering of
> directories when PHP uses the readdir method? And is there anyway to force
> a specific ordering to the directories before PHP searches down them?
If you're on PHP 5, lo
On Fri, September 15, 2006 2:18 pm, Toby Osbourn wrote:
> I suppose my question put simply is, what is the default ordering of
> directories when PHP uses the readdir method?
Whatever order the OS decides to use.
In practice, it's whatever is convenient for that particular file system.
So FAT, N
filemtime() and sort() to sort the array.
Hope that helps,
Brad
-Original Message-
From: Toby Osbourn [mailto:[EMAIL PROTECTED]
Sent: Friday, September 15, 2006 3:18 PM
To: php-general@lists.php.net
Subject: [PHP] readdir
I have been writing some code that visits each directory stored within
I have been writing some code that visits each directory stored within one
directory in turn, pics a random image from it and displays that image.
I have the code working fine, apart from one small quirk that I can't really
understand.
In one version of the implementation, the directories appear
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
Lin
On Tue, August 15, 2006 11:00 pm, John Meyer wrote:
> Richard Lynch wrote:
>
>> Do you really mean opendir() or do you mean readdir() ???
>
>
> readdir().
>
> The point is why do you need to put it as
> !==
>
> vs.
> !=
http://us3.php.net/manual/en/language.types.type-juggling.php
--
Like Music?
John Meyer wrote:
Richard Lynch wrote:
Do you really mean opendir() or do you mean readdir() ???
readdir().
The point is why do you need to put it as
!==
vs.
!=
They mean different things.
!== means "check the values are not the same AND check their types".
!= means "check the values
Richard Lynch wrote:
> Do you really mean opendir() or do you mean readdir() ???
readdir().
The point is why do you need to put it as
!==
vs.
!=
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, August 15, 2006 5:56 pm, John Meyer wrote:
> Richard Lynch wrote:
>> On Tue, August 15, 2006 12:04 pm, John Meyer wrote:
>>> I have a script to list the files in a directory:
>>>
>>>
>>> >> $open = opendir(".");
>>> while ($file = readdir($open) != false) {
>>> ?>
>>>
>>> >>
Richard Lynch wrote:
> On Tue, August 15, 2006 12:04 pm, John Meyer wrote:
>> I have a script to list the files in a directory:
>>
>>
>> > $open = opendir(".");
>> while ($file = readdir($open) != false) {
>> ?>
>>
>> > }
>> ?>
>>
>>
>>
>> And all I am getting are "1"s. I t
On Tue, August 15, 2006 12:04 pm, John Meyer wrote:
> I have a script to list the files in a directory:
>
>
>$open = opendir(".");
> while ($file = readdir($open) != false) {
> ?>
>
>}
> ?>
>
>
>
> And all I am getting are "1"s. I think I'm doing it right, what is
>
t: http://www.php.net/unsub.php
Straight from the PHP readdir help... http://uk2.php.net/readdir
It does however strip out '.' or '..' but I'm sure you'll get the hang of
it.
HTH
I have a script to list the files in a directory:
And all I am getting are "1"s. I think I'm doing it right, what is the
disconnect?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
When I read the directory, if the file has more than one "white spaces",
readdir only return me
the file with one space ...
so if I have on the file system . "ROAD 1 005.JPG" or "ROAD 1
0005.JPG" php readdir
return me ROAD 1 005.JPG!!
[/sni
Hello, I the following problem with readdir
When I read the directory, if the file has more than one "white spaces",
readdir only return me
the file with one space ...
so if I have on the file system . "ROAD 1 005.JPG" or "ROAD 1
0005.JPG" php read
On Tue, November 22, 2005 8:23 am, Graham Cossey wrote:
> I'm attempting to read a list of files in a directory using readdir()
> but am having problems with mpeg files not seemingly being read.
>
> Cope snippet:
>
> $count = 0;
> while (false !== ($file = readdir($open_dir)))
> {
[snip all]
OK, of course it's my fault !! :o
My directory variables are using relative paths and I was trying to
access the parent directory from the sub-directory but not using '..'
Sorry.
Thanks for your help.
--
Graham
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
[snip]
> If file exists is looking for an associated files is it probable that the
> .mpg files do not have one associated with it in the other directory?
It is probable, that's why the check is there, but in this case the
associated file(s) definitely does exist. If I simply change the file
exten
Graham,
Is safe mode enabled in your config file? If safe mode is on, PHP will
check the file to ensure it is owned by the same user executing the
script. If this condition fails, file_exists() will not work on the file.
http://php.net/file_exists
http://php.net/manual/en/features.safe-mode.php
[snip]
> Make sure to always hit reply-all, or the e-mail will not go back to the
> list.
Yep, realised that after hitting 'send'. :-(
> If file exists is looking for an associated files is it probable that the
> .mpg files do not have one associated with it in the other directory?
It is probabl
[snip]
Yes $open_dir is the handle from opendir().
The file_exists is simply checking for an associated file elsewhere as
I'm looking for video files and thumbnails.
As I said, this works fine for avi suffixed files but not mpg or mpeg
suffixed files.
[/snip]
Make sure to always hit reply-all, o
On 11/22/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> I'm attempting to read a list of files in a directory using readdir()
> but am having problems with mpeg files not seemingly being read.
>
> Cope snippet:
>
> $count = 0;
> while (false !== ($file = readdir($open_dir))
[snip]
I'm attempting to read a list of files in a directory using readdir()
but am having problems with mpeg files not seemingly being read.
Cope snippet:
$count = 0;
while (false !== ($file = readdir($open_dir)))
{
if ($file != '.' && $file != '..')
{
I'm attempting to read a list of files in a directory using readdir()
but am having problems with mpeg files not seemingly being read.
Cope snippet:
$count = 0;
while (false !== ($file = readdir($open_dir)))
{
if ($file != '.' && $file != '..')
{
I'm having a really weird problem. My code works, unless the images start with
a number, then I get a 500 error. If they start with a letter it's fine.
some example of problem files:
178_image.jpg
0005396C.jpg
the whole reason I wrote this code was so that I wouldn't have to rename all my
file
On Monday 20 September 2004 11:44, Jason FB wrote:
> Hereis my script, I copied and pasted Example 1 from this page:
>
> http://us4.php.net/manual/en/function.readdir.php
>
>
> You will see that the only way that I changed I initialize two
> variables at the very top that set the directory of the
PHP General List,
I am trying to read the contents of a directory on a server and
perform imagemagick operations on each JPG found inside the
directory. The area where I am stuck currently is not the image
manipulation but the PHP function readdir().
Can anyone explain why I am having this beha
Simple question : do readdir and opendir support opening HTTP urls ??
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$img_count = 0;
echo("
My Images"):
(loop through filenames)
{
if (($img_count % 5) == 0) echo("
");
echo("
");
$img_count = $img_count + 1;
}
while (($img_count % 5) != 0)
{
echo("
");
}
echo("
")
Matt
RClark <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EM
Hello all!
Ok, I have a readdir() reading pictures files from a directory. But now I
want to output them into a html table, say 5 across the top row, then 5 the
next row, etc. What I cant figure out is how to make this happen. Right now,
I am not reading the files into an array. Should I do this a
>if ($handle = opendir('/my/directory')) {
> echo "Directory handle: $handle\n";
> echo "Files:\n";
>
>
>
> while (false !== ($file = readdir($handle))) {
> echo "$file\n";
> }
Everything is good, you just to make a slight addition to your echo.
echo "$file"
-Danny
"You
On Friday 02 August 2002 02:53, [EMAIL PROTECTED] wrote:
> New To Php so please bear with me... :)
>
> I used the readdir function to read the files listed on a Apache server.
> And it worked fine.
> http://www.optimus7.com/findme.php is the result I get from the php
> code below. Help!
>
> if
Change:
echo "$file\n";
to:
echo "$file\n";
Note the nested quotes -- outer quotes - ", inner quotes (around $file)
single - '
Best,
Nicole
[EMAIL PROTECTED] wrote:
>New To Php so please bear with me... :)
>
>I used the readdir function to read the files listed on a Apache server. And
>it
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 2:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Readdir
>
> New To Php so please bear with me... :)
>
> I used the readdir function to read the files listed on a
> Apache server
New To Php so please bear with me... :)
I used the readdir function to read the files listed on a Apache server. And
it worked fine. Now I would like to be able to get the files the php code
returns, to be links. Where the user can click the file and download it. Also
for the files to sit within
56 matches
Mail list logo