hey_im_chris Posted July 8, 2006 Share Posted July 8, 2006 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 14Warning: readdir(): supplied argument is not a valid Directory resource in /home/.../album.php on line 16Warning: 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? Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/ Share on other sites More sharing options...
ShogunWarrior Posted July 8, 2006 Share Posted July 8, 2006 Well basically it can't find /home/imgs/thumbsMake sure that your referencing it right, and if there should be a leading/ending slash. Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-54957 Share on other sites More sharing options...
hey_im_chris Posted July 8, 2006 Author Share Posted July 8, 2006 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. Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-54972 Share on other sites More sharing options...
ShogunWarrior Posted July 8, 2006 Share Posted July 8, 2006 I think it's calling the script fine, the problem is INSIDE album.php, it is having trouble opening the imgs/thumbs folder. Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-54973 Share on other sites More sharing options...
hey_im_chris Posted July 8, 2006 Author Share Posted July 8, 2006 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] Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-54974 Share on other sites More sharing options...
ShogunWarrior Posted July 9, 2006 Share Posted July 9, 2006 Well, if the [b]imgs[/b] folder or the [b]imgs/thumbs/[/b] folder do not exist then there's the problem. Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-55086 Share on other sites More sharing options...
hey_im_chris Posted July 9, 2006 Author Share Posted July 9, 2006 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! ::) Link to comment https://forums.phpfreaks.com/topic/14059-opendir-readdir-closedir-warnings/#findComment-55220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.