Re: How do you make a directory
| From: | Tech Support | Date: | Wed, 24 Jul 2002 03:29:45 +0000 |
| Subject: | Re: How do you make a directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109206@lists.php.net to get a copy of this message | ||
How about a trailing slash after the directory name ;-)
like this:
$dirpath = "/home/sites/home/users/demodocs/web/userforum/" . $username;
you had:
$dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username;
which would try to create a new directory inside the web directory.
die("$dirpath"); // excellent for debugging :-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Roger Lewis" <re.lewis@attbi.com>
To: "Php-General" <php-general@lists.php.net>
Sent: Tuesday, July 23, 2002 10:12 PM
Subject: [PHP] How do you make a directory
> I'm trying to learn to create a directory in php, and from everything I've
> read I created this simple test that I put into the file add_user_dir.php.
> Unfortunately I can't get it to work. I am getting the error message:
>
> Warning: MkDir failed (Permission denied) in
> /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20.
>
> Obviously, it has something to do with permissions. I have chmod for the
> directory 'userforum' set to 0777. I tried playing around with umask, and
> changing the chmod, but I can't get anything to work.
>
> I am using PHP 4.0.6 with Apache 1.3.20
>
> Here is the script:
>
> <form action="<? echo $PHP_SELF; ?>" method="post"
> name="FormName">
> <p>User Name<input type="text" name="username" size="24"
> border="0">
> <input type="submit" name="submitButtonName" value="Make
> Directory"
> border="0"></p>
> </form>
>
> <?php
> $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username;
> mkdir($dirpath, 0777);
> ?>
>
> Can anyone see what I am doing wrong? Thanks.
>
> Roger Lewis
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>