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

Reply via email to