amiteshpurwar Posted June 29, 2009 Share Posted June 29, 2009 Why this code is not working..?? i m a noob. Please Help me. $dir = "http://googleblog.blogspot.com/2006"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; } closedir($dh); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/164081-about-directory-contents-in-web/ Share on other sites More sharing options...
dzelenika Posted June 29, 2009 Share Posted June 29, 2009 AFAIK $dir doesn't support http:// URL wrapper. Quote Link to comment https://forums.phpfreaks.com/topic/164081-about-directory-contents-in-web/#findComment-865563 Share on other sites More sharing options...
Adam Posted June 29, 2009 Share Posted June 29, 2009 4.3.0 : path can also be any URL which supports directory listing I think it does, but I don't think $dir is a valid listing: http://googleblog.blogspot.com/2006 Quote Link to comment https://forums.phpfreaks.com/topic/164081-about-directory-contents-in-web/#findComment-865566 Share on other sites More sharing options...
dzelenika Posted June 29, 2009 Share Posted June 29, 2009 On my server (windows) I got this warning: Warning: opendir(http://localhost/test) [function.opendir]: failed to open dir: not implemented in ... Quote Link to comment https://forums.phpfreaks.com/topic/164081-about-directory-contents-in-web/#findComment-865573 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.