Reply to Re: Trouble with mkdir($variable)

Your name:

Reply:


Posted by bish on 02/15/06 13:19

On Wed, 15 Feb 2006 11:10:06 GMT, "d" <d@example.com> wrote:

>>>"bish" <info@bish.org> wrote in message
>>>news:lg26v19qpqbc08tlqt2lh1qlrsa3t47j96@4ax.com...
>>>> I do voluntary web work for a small local charity. The new
>>>> chairman wants to have each of his caseworkers upload their latest
>>>> work file into their own directory (called after the caseworker's
>>>> $username passed from the log-in script) so he can examine them
>>>> remotely.
>>>> The idea is also that, if the volunteer is new, a new directory
>>>> called after the new caseworker's $username be created and their
>>>> file put into it.
>>>> I've tried all kinds of variations of the following but get error
>>>> messages.
>>>
>>>Have you ensured that the $username variable actually has a name in it?
>>>
>>>Also, are you chdir()ing to the directory in which these directories should
>>>be created? Or do you prepend that path to the $username before you call
>>>mkdir()?
>>>
>>>> <?
>>>> if (!is_dir($username))
>>>> {
>>>> // make the directory;
>>>> mkdir($username, 0777) or die ("Could not make directory");
>>>> // then copy the file into the directory;
>>>> }
>>>> else
>>>> {
>>>> // just copy the file into the directory;
>>>> }
>>>> ?>
>>>>
>>>> Warning: mkdir(): No such file or directory in
>>>> /home/earlpa11/public_html/funds/forma_upload_handle1.php on line
>>>> 5
>>>> Could not make directory
>>>>
>>>> In addition, a simple file -
>>>> <?
>>>> mkdir("new_directory", 0777);
>>>> ?>
>>>> works perfectly well but the permissions are 0755. I can change
>>>> this with my ftp, but that's not what's wanted.
>>>> phpinfo() on my server tells me safe_mode is off, locally and
>>>> globally.
>>>>
>>>> Can anyone help, please?
>>>>
>>>> I hope I've put the problem clearly.
>>>>
>>>> Thank you in anticipation.
>>>
Quick response, thank you.

Yes, the $username transfers fine through $_SESSION.

The script lies in /funds/ and the idea is that it should make the
new directories as sub-directories of /funds/

[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

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