Re: chdir() help
| From: | Kurt Lieber | Date: | Sat, 07 Jul 2001 18:14:36 +0000 |
| Subject: | Re: chdir() help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-56653@lists.php.net to get a copy of this message | ||
We (or at least I) are on the mailing list, not the newsgroup. Same
content, different delivery format. www.php.net to sign up. (beware -- it's
a HIGH volume list)
--kurt
"McShen" <hshen@crosswinds.net> wrote in message
news:20010707180423.36182.qmail@pb1.pair.com...
> by the way, what do u guys use as your news reader client?
> how do u reply to my post and send me an email at the same time? Do u
> manually add my email to Cc: or you just hit "reply to group"? I don't
know
> how to do this.
>
> "Kurt Lieber" <php@internalcombustion.com> wrote in message
> news:0c7f01c106fc$9c32e170$0201010a@internalcombustion.com...
> > Look at your code -- where do you tell it to set $file_name equal to the
> > file handles within e:\work\images? $file_name is only being set to the
> > values within e:\work -- not e:\work\images.
> >
> > If you only need to display the images within e:\work\images, then why
not
> > just set $dir_name to that in the first place? Otherwise (I believe)
> you're
> > going to have to use two separate while ($file_name=readdir($dir))
> clauses
> > (or nest them, depending on what you really want to output)
> >
> > hth
> >
> > --kurt
> > ----- Original Message -----
> > From: "McShen" <hshen@crosswinds.net>
> > To: <php-general@lists.php.net>
> > Sent: Saturday, July 07, 2001 8:38 AM
> > Subject: [PHP] chdir() help
> >
> >
> > hi
> >
> > Currently, i am working in e:\work, and there is a folder named "image"
> > under e:\work, so, the path to image is e:\work\image.
> >
> > I have a script under e:\work, and i wanna display all images under the
> > folder e:\work\image, I use chdir() to change the directory. but it
> wouldn't
> > work. it still displays the images under e:\work. Why is that? Does
> chdir()
> > work under win2k pro? here is my script
> >
> > -------
> > <?php
> >
> >
> > $dir_name = "e:\work";
> > $dir = opendir($dir_name);
> > while ($file_name=readdir($dir)) {
> >
> > if (($file_name!="." && $file_name!="..")) {
> > echo $file_name."\n ";
> >
> > if (chdir('e:\work\image')) {
> > echo "current dir is e:\work\image";
> > }
> > echo "<IMG SRC=$file_name>";
> > }
> > }
> > closedir($dir);
> > ?>
> > -----
> >
> > Please help me to fix the problem. Thanks.
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>