Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.