Reply to Re: mkdir sucks, really

Your name:

Reply:


Posted by Schraalhans Keukenmeester on 06/01/07 06:56

At Fri, 01 Jun 2007 04:20:18 +0000, Cris let h(is|er) monkeys type:

> OK, I do this call on a linux system:
>
> if(!file_exists("../pages/".$_POST['ParentName']."/"))
> {
> $dirname = "/home/u2/sss/sss/html/pages/".$_POST['ParentName']."";
> mkdir($dirname, $mode);
>
> }
>
> and get this:
>
> Warning: mkdir() [function.mkdir]: File exists in /home/u2/mypage.php
> on line 19
>
> When it clearly doesn't exist! I looked!
>
> HELP!

What does $_POST['Parentname'] contain ? Echo it's value to check.
The warning would make sense if it's empty. And get rid of the '/' in the
file_exists line. At best it doesn't make a difference.

Why use a relative path first, followed by an absolute path?

mkdir doesn't suck, really. It creates a directory or returns false and
throws a warning if that process fails.

--
Schraalhans Keukenmeester - schraalhans@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]

"strcmp('apples','oranges') < 0"

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация