Re: [PHP] Problem with is_dir function
I cannot explain your error message, are you sure that the following error message provide from these lines ? If not, I think your machine is blasted, so find out an exorcist or a witch. Good luck ! - Original Message - From: "Roger Lewis" <[EMAIL PROTECTED]> To: "Roger Lewis" <[EMAIL PROTECTED]>; "Php-General" <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 3:41 AM Subject: RE: [PHP] Problem with is_dir function > > On Saturday, November 02, 2002 11:07 AM, I wrote > > * > I'm having a problem with the is_dir function, or maybe I don't > understand > > how it supposed to work. I'm using the following code to check whether or > > not a directory called $user_dir exists. If it exists, I am returned the > > proper message. But if it doesn't exist, I get the following error > message > > that says that it doesn't exist. (I already knew that!) > > > > > > > Can someone please explain what I am doing wrong here, and how to return a > > usable value if the directory doesn't exist. > > > > $test = is_dir($user_dir); > > if($test){echo "You have a user directory. It is $user_dir";} > > else{echo "Your user directory doesn't exist"; > > return;} > > > > Thanks a lot. > > > Roger Lewis > > > This is a follow-up to my original posting. > * I did not get an answer as to why is_dir does not return a "false" value; > however, file_exists does the job nicely. Thanks for all the suggestions. > * Roger > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with is_dir function
On Saturday, November 02, 2002 11:07 AM, I wrote * > I'm having a problem with the is_dir function, or maybe I don't understand > how it supposed to work. I'm using the following code to check whether or > not a directory called $user_dir exists. If it exists, I am returned the > proper message. But if it doesn't exist, I get the following error message > that says that it doesn't exist. (I already knew that!) > Can someone please explain what I am doing wrong here, and how to return a > usable value if the directory doesn't exist. > $test = is_dir($user_dir); > if($test){echo "You have a user directory. It is $user_dir";} > else{echo "Your user directory doesn't exist"; > return;} > Thanks a lot. > Roger Lewis This is a follow-up to my original posting. * I did not get an answer as to why is_dir does not return a "false" value; however, file_exists does the job nicely. Thanks for all the suggestions. * Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with is_dir function
I believe the path is of the correct format. So for example, if $user_dir = /home/sites/home/users/demodocs/web/userforum/user and $user_dir exists, then is_dir($user_dir) should = 1 however, if $user_dir doesn't exist, then is_dir($user_dir) should = 0 Isn't this the correct logic? Roger -Original Message- From: Andrew Brampton [mailto:andrew@;bramp.freeserve.co.uk] Sent: Saturday, November 02, 2002 11:24 AM To: Roger Lewis; [EMAIL PROTECTED] Subject: Re: [PHP] Problem with is_dir function what values of $user_dir are you passing to is_dir? echo them out before the test, you might be sending paths which are most certainly not directories... for example: c:\windows /home/blah would be valid, but c:\windows\win.com /home/blah/myfile http://somesite/somepath ftp://someftpserver/incoming are invalid Hope this helps Andrew - Original Message - From: "Roger Lewis" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Saturday, November 02, 2002 7:06 PM Subject: [PHP] Problem with is_dir function > I'm having a problem with the is_dir function, or maybe I don't understand > how it supposed to work. I'm using the following code to check whether or > not a directory called $user_dir exists. If it exists, I am returned the > proper message. But if it doesn't exist, I get the following error message > that says that it doesn't exist. (I already knew that!) > > > > > Can someone please explain what I am doing wrong here, and how to return a > usable value if the directory doesn't exist. > > > $test = is_dir($user_dir); > if($test){echo "You have a user directory. It is $user_dir";} > else{echo "Your user directory doesn't exist"; > return;} > > > Thanks a lot. > > Roger Lewis > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with is_dir function
what values of $user_dir are you passing to is_dir? echo them out before the test, you might be sending paths which are most certainly not directories... for example: c:\windows /home/blah would be valid, but c:\windows\win.com /home/blah/myfile http://somesite/somepath ftp://someftpserver/incoming are invalid Hope this helps Andrew - Original Message - From: "Roger Lewis" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Saturday, November 02, 2002 7:06 PM Subject: [PHP] Problem with is_dir function > I'm having a problem with the is_dir function, or maybe I don't understand > how it supposed to work. I'm using the following code to check whether or > not a directory called $user_dir exists. If it exists, I am returned the > proper message. But if it doesn't exist, I get the following error message > that says that it doesn't exist. (I already knew that!) > > > > > Can someone please explain what I am doing wrong here, and how to return a > usable value if the directory doesn't exist. > > > $test = is_dir($user_dir); > if($test){echo "You have a user directory. It is $user_dir";} > else{echo "Your user directory doesn't exist"; > return;} > > > Thanks a lot. > > Roger Lewis > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with is_dir function
I'm having a problem with the is_dir function, or maybe I don't understand how it supposed to work. I'm using the following code to check whether or not a directory called $user_dir exists. If it exists, I am returned the proper message. But if it doesn't exist, I get the following error message that says that it doesn't exist. (I already knew that!) http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php