Create dir. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Create dir.

d00zerd00zer Posts: 7Member
Why dosent this code snippet work:
(The $name varible gets its value from a tag.

$name = $_POST['projname'];
...
...


)
[code]
$projdir = '/home/neux/www/projects/';
$path_name = $location.$name;

function createdir($location,$name)
{

$path_name = $location.$name;
echo "Creating: ".$path_name;

if((mkdir($path_name)) == TRUE)
{
chmod($path_name,0666);
echo "
Directory created: ".$path_name;
return TRUE;
} else { echo "
Failed to create dir: ". $path_name."
";
return FALSE; }
}
[/code]

Have try with alot and it faild every time to create the dir.
//d00zer
n e v e r s l o w d o w n

Comments

  • DarQDarQ Posts: 1,625Member
    is there an error??? also, do an echo $_POST['projname'] in the beginning.. see if the value really comes in your script
    : Why dosent this code snippet work:
    : (The $name varible gets its value from a tag.
    :
    : $name = $_POST['projname'];
    : ...
    : ...
    :
    :
    : )
    : [code]
    : $projdir = '/home/neux/www/projects/';
    : $path_name = $location.$name;
    :
    : function createdir($location,$name)
    : {
    :
    : $path_name = $location.$name;
    : echo "Creating: ".$path_name;
    :
    : if((mkdir($path_name)) == TRUE)
    : {
    : chmod($path_name,0666);
    : echo " Directory created: ".$path_name;
    : return TRUE;
    : } else { echo "Failed to create dir: ". $path_name."";
    : return FALSE; }
    : }
    : [/code]
    :
    : Have try with alot and it faild every time to create the dir.
    : //d00zer
    : n e v e r s l o w d o w n
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • flankovichflankovich Posts: 1Member
    Verify if the directoy has chmod for write to apache user

    : is there an error??? also, do an echo $_POST['projname'] in the beginning.. see if the value really comes in your script
    : : Why dosent this code snippet work:
    : : (The $name varible gets its value from a tag.
    : :
    : : $name = $_POST['projname'];
    : : ...
    : : ...
    : :
    : :
    : : )
    : : [code]
    : : $projdir = '/home/neux/www/projects/';
    : : $path_name = $location.$name;
    : :
    : : function createdir($location,$name)
    : : {
    : :
    : : $path_name = $location.$name;
    : : echo "Creating: ".$path_name;
    : :
    : : if((mkdir($path_name)) == TRUE)
    : : {
    : : chmod($path_name,0666);
    : : echo " Directory created: ".$path_name;
    : : return TRUE;
    : : } else { echo "Failed to create dir: ". $path_name."";
    : : return FALSE; }
    : : }
    : : [/code]
    : :
    : : Have try with alot and it faild every time to create the dir.
    : : //d00zer
    : : n e v e r s l o w d o w n
    : :
    :
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://mark.space.servehttp.com
    :
    :

Sign In or Register to comment.