PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Create dir. Posted by d00zer on 10 Oct 2003 at 2:59 AM
Why dosent this code snippet work:
(The $name varible gets its value from a <form> tag.

$name = $_POST['projname'];
...
...
<input name="projname" type="text" size=20 maxlength=25>

)
$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 "<br> Directory created: ".$path_name;
    return TRUE;
  } else {  echo "<br>Failed to create dir: ". $path_name."<br>";
            return FALSE; }
}


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
Report
Re: Create dir. Posted by DarQ on 10 Oct 2003 at 3:15 AM
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 <form> tag.
:
: $name = $_POST['projname'];
: ...
: ...
: <input name="projname" type="text" size=20 maxlength=25>
:
: )
:
: $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; }
: }
: 

:
: 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
:

DarQ
url--> http://mark.space.servehttp.com

Report
Re: Create dir. Posted by flankovich on 10 Oct 2003 at 9:53 AM
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 <form> tag.
: :
: : $name = $_POST['projname'];
: : ...
: : ...
: : <input name="projname" type="text" size=20 maxlength=25>
: :
: : )
: :
: : $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; }
: : }
: : 

: :
: : 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
: :
:
: DarQ
: url--> http://mark.space.servehttp.com
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.