How do you make a directory
| From: | Roger Lewis | Date: | Wed, 24 Jul 2002 03:12:53 +0000 |
| Subject: | How do you make a directory | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-109203@lists.php.net to get a copy of this message | ||
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