[PHP-WIN] problem to open dir

2004-11-29 Thread Pravin-Kumar
hi all
i am getting some unexpected error while try to read a local dir..
it is working on the pc where apache is running ..but same code not 
working while trying from other pcs in lan..
here is code..
$dir="C:\Documents and Settings\pravin\Desktop\abcd2";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
   while (($file = readdir($dh)) !== false) {
  echo "filename: $file : filetype: " . filetype($dir . $file) ."\n";
   }
   closedir($dh);
 }
}

$dir = dir($source);


giving error:
Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2): failed to 
open dir: Invalid argument in G:\Vyapar\AdvMgmt\addadvt3.php on line 
69

Fatal error: Call to a member function on a non-object in 
G:\Vyapar\AdvMgmt\addadvt3.php on line 70
 



-
Experience is what you get when you didn't get what you wanted.
-
Regards
Pravin Kumar
Technical Associate, CDAC, 68, E-City, Bangalore, 560100.
Registered Linux user #365056; Ph. +91 80 28523300 Extn:2103
http://geocities.com/pravin_suman/
http://pravindeo.blogspot.com

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-WIN] problem to open dir

2004-11-29 Thread Pravin-Kumar

hi mike!
$source='F:\cdac2';
echo $source;
if(is_dir($source)){echo "it is a dir.";}
else{echo "it is not a dir..";}


i had tried ur suggestion .. not working dude :(
see i had one more thing .. it says "it is not a dir.."
please help me list...

-
Regards
Pravin Kumar

On Tue, 30 Nov 2004, Mike wrote:

> When you set the $dir variable, try doing so with single quotes - the \
> character is used to escape things and might be causing some problems.
> 
> If that makes no sense, it's because I'm falling asleep.
> 
> Good luck.
> 
> -M 
> 
> > -Original Message-
> > From: Pravin-Kumar [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, November 30, 2004 12:37 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] problem to open dir
> > 
> > hi all
> > i am getting some unexpected error while try to read a local dir..
> > it is working on the pc where apache is running ..but same 
> > code not working while trying from other pcs in lan..
> > here is code..
> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if 
> > (is_dir($dir)) {
> > if ($dh = opendir($dir)) {
> >while (($file = readdir($dh)) !== false) {
> >   echo "filename: $file : filetype: " . filetype($dir 
> > . $file) ."\n";
> >}
> >closedir($dh);
> >  }
> > }
> > 
> > $dir = dir($source);
> > 
> > 
> > giving error:
> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2): 
> > failed to open dir: Invalid argument in 
> > G:\Vyapar\AdvMgmt\addadvt3.php on line
> > 69
> > 
> > Fatal error: Call to a member function on a non-object in 
> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70
> >  
> > 
> > 
> > 
> > -
> > Experience is what you get when you didn't get what you wanted.
> > -
> > Regards
> > Pravin Kumar
> > Technical Associate, CDAC, 68, E-City, Bangalore, 560100.
> > Registered Linux user #365056; Ph. +91 80 28523300 Extn:2103
> > http://geocities.com/pravin_suman/
> > http://pravindeo.blogspot.com
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-WIN] problem to open dir

2004-11-30 Thread Pravin-Kumar
hi list!
 
 $dest='F:/vyapar-2/test/cdaci'; or 
 $dest='F:\vyapar-2\test\cdaci'; or
 $dest='F:\\vyapar-2\\test\\cdaci'; or
 $dh = opendir($dest);
 $a=dir($dest);

the above code giving following problem on apache 1.3  on windows

Warning: opendir(F:/vyapar-2/test/cdaci): failed to open dir: Invalid
argument in G:\Vyapar-2.0\test\1.php on line 10

Warning: dir(F:/vyapar-2/test/cdaci): failed to open dir: Invalid argument
in G:\Vyapar-2.0\test\1.php on line 11

--
Nothing is working i had tried \\ , /, "double quot", 'single quot'

-
Regards
Pravin Kumar

On Tue, 30 Nov 2004, Mike wrote:

> When you set the $dir variable, try doing so with single quotes - the \
> character is used to escape things and might be causing some problems.
> 
> If that makes no sense, it's because I'm falling asleep.
> 
> Good luck.
> 
> -M 
> 
> > -Original Message-
> > From: Pravin-Kumar [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, November 30, 2004 12:37 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] problem to open dir
> > 
> > hi all
> > i am getting some unexpected error while try to read a local dir..
> > it is working on the pc where apache is running ..but same 
> > code not working while trying from other pcs in lan..
> > here is code..
> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if 
> > (is_dir($dir)) {
> > if ($dh = opendir($dir)) {
> >while (($file = readdir($dh)) !== false) {
> >   echo "filename: $file : filetype: " . filetype($dir 
> > . $file) ."\n";
> >}
> >closedir($dh);
> >  }
> > }
> > 
> > $dir = dir($source);
> > 
> > 
> > giving error:
> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2): 
> > failed to open dir: Invalid argument in 
> > G:\Vyapar\AdvMgmt\addadvt3.php on line
> > 69
> > 
> > Fatal error: Call to a member function on a non-object in 
> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70
> >  
> > 
> > 
> > 
> > -
> > Experience is what you get when you didn't get what you wanted.
> > -
> > Regards
> > Pravin Kumar
> > Technical Associate, CDAC, 68, E-City, Bangalore, 560100.
> > Registered Linux user #365056; Ph. +91 80 28523300 Extn:2103
> > http://geocities.com/pravin_suman/
> > http://pravindeo.blogspot.com
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-WIN] How to parse XML in php

2004-12-20 Thread Pravin-Kumar
hi!
How can i parse a xml file in php. need to do some extension enable or 
what? give me some details. i had tried xml_parse() yet but not working :(

i am getting error messages.

Warning: xml_parse(): Unable to call handler startElement() in 
f:\xml\xml.php on line 23


--thanks 
pravin d.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php