Jump to content

Archived

This topic is now archived and is closed to further replies.

hey_im_chris

opendir, readdir, closedir warnings?

Recommended Posts

Hi, I've come up with a good plan to work around my last includes problem, and it's flawless... with everything but the page I want to call. The page I'm trying to include is a php script for an image gallery I pulled off the net about a year ago. If anyone can help and they'd like to take a look at it, you're very welcome. Anyway...

When I call that particular page, I get 3 warning errors:

[quote]Warning: opendir(imgs/thumbs): failed to open dir: No such file or directory in /home/.../album.php on line 14

Warning: readdir(): supplied argument is not a valid Directory resource in /home/.../album.php on line 16

Warning: closedir(): supplied argument is not a valid Directory resource in /home/.../album.php on line 49[/quote]

Any ideas what this means and how to resolve this?

Share this post


Link to post
Share on other sites
Well basically it can't find /home/imgs/thumbs

Make sure that your referencing it right, and if there should be a leading/ending slash.

Share this post


Link to post
Share on other sites
Well I thought that it might have been a problem with the directory, but it isn't because the page, album.php works fine if I view it directly, but it doesn't work if I call for it in the include.

The include basically says [i]$set .= "/album.php";[/i] with the link set as [i]index.php?set=directory[/i] ,so it calls ./directory/album.php, which should work. I'm just confused as to why it doesn't.

Share this post


Link to post
Share on other sites
I think it's calling the script fine, the problem is INSIDE album.php, it is having trouble opening the imgs/thumbs folder.

Share this post


Link to post
Share on other sites
Lines 14, 16 and 49 all refer to '$myDirectory' and use it in [i]$myDirectory = opendir("imgs/thumbs");[/i], [i]while ($file = readdir($myDirectory))[/i] and [i]closedir($myDirectory);[/i] respectively. If you'd like to take a look, I'll attach album.php in a moment! :)

[attachment deleted by admin]

Share this post


Link to post
Share on other sites
Well, if the [b]imgs[/b] folder or the [b]imgs/thumbs/[/b] folder do not exist then there's the problem.

Share this post


Link to post
Share on other sites
That's just an insult to my intelligence! ;) My directories are set up perfectly fine, otherwise they wouldn't work when I view the page directly. Do you think there's a chance that it's looking for the filepath ./album.php/imgs/thumbs? It's a bit daft, but I'm running out of ideas! ::)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.