You are here: Re: Trouble with mkdir($variable) « All PHP « IT news, forums, messages
Re: Trouble with mkdir($variable)

Posted by bish on 02/16/06 01:31

On Wed, 15 Feb 2006 18:55:24 +0100, "J.O. Aho" <user@example.net>
wrote:

>>>bish wrote:
>>>> 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.
>>>>
>>>> <?
>>>> 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
>>>
>>>What about using absolute path,
>>>mkdir("/home/earlpa11/public_html/funds/$username");
>>>chmod("/home/earlpa11/public_html/funds/$username",01777);
>>>
>>>Remember that the user that your Apache server is running as (can be apache,
>>>http, httpd, nobody, ...) has the right to write to the directory in question.
>>>
>>>
>>> //Aho

Thank you.

Do you mean that if I don't put the full absolute path that anyone
can write to the directory?

When the present task is over I'll experiment with the full path
as you suggest but, for now, I don't understand the 01777? Was
it just a typo?
Yoooors,

Iain.

 

Navigation:

[Reply to this 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

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