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

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");

 

}

}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.