Jump to content

Help with creating directories on server!


daxguy

Recommended Posts

I have written a piece of code that create a directories, files on the server using mkdir and touch and also inserts the form data into the table.. the code gets executed and the info gets stored in the database but the part which has the create directories. and files dont work as it doesnt create the directory and files on the server.. do i need to make changes to the php.ini file to enable the mkdir and touch feature to get enabled? as i said the code executes without any error.. I dont know wat to do.. please any help would be appreciated!!

thanku

Link to comment
Share on other sites

i tried adding file permission to the folder on which the directories and the files were being created.. and it worked 1ce and i dunno wats up with it.. it aint working again

the code is

 

 

$title = $_POST['title'];

 

if(is_dir("news_upload"))

{

if(is_dir("news_upload/$year"))

{

if(is_dir("news_upload/$year/$month"))

{

if(is_dir("news_upload/$year/$month/$day"))

{

 

touch("news_upload/$year/$month/$day/$title.php");

}

else

{

mkdir("news_upload/$year/$month/$day");

touch("news_upload/$year/$month/$day/$title.php");

}

}

else

{

mkdir("news_upload/$year/$month");

mkdir("news_upload/$year/$month/$day");

touch("news_upload/$year/$month/$day/$title.php");

 

}

 

}

else

{

mkdir("news_upload/$year");

mkdir("news_upload/$year/$month");

mkdir("news_upload/$year/$month/$day");

touch("news_upload/$year/$month/$day/$title.php");

 

}

}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.