Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2005, 06:28 AM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to dibakar_datta
Default confused on opendir()

  I am going through a very sticky problem. I am running this script from one domain
  (churchsiteonline.com)in the same server where the other domain (sermonnetwork.com) is
  also present. I want to open a directory of sermonnetwork.com from the place where the
  script is running.

  But, i am getting the E_WARNNING : "failed to open directory invalid path given" always.
  where as the path is correct.

  As per my server description i am running on windows 2003 with IIS and PHP 4.3
  configure with it.

  Please, give your suggestion if anyone also face the same acute problem which i am
  facing right now. (I've also use the chdir() function. but do not get any good result.)

  below is code snippet which i tried.
  -------------------------------------------------------------------------------
   #Set the path.
   $basePath = "C:\\Inetpub\\vhosts\\sermonnetwork.com\\httpdocs\ \diba\\";

   //chdir($basePath);

      // Open a known directory, and proceed to read its contents
      if (is_dir($basePath)) {
              if ($dh = opendir($basePath)) {
               while (($file = readdir($dh)) !== false) {
                   echo "filename: $file : filetype: " . filetype($basePath . file) . "\n";
               }
               closedir($dh);
           }
      }
 -----------------------------------------------------------------------------------

  thanks


dibakar
 
Old March 12th, 2006, 09:12 AM
Registered User
 
Join Date: Dec 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to spbharti
Default

if your is script on the same server try to use relative path such as /diba/basepath





Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: opendir(c: Inetpub vhosts f5only Beginning PHP 0 December 17th, 2007 12:27 AM
the Figure 1-3 confused me EdwardChou BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 May 12th, 2007 05:48 PM
confused mohabedalgani VB.NET 2002/2003 Basics 3 March 30th, 2005 11:48 PM
I'm Confused. Help!!! dangel75 General .NET 1 July 10th, 2004 09:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.