creating directories help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
daxguy
Forum Newbie
Posts: 1
Joined: Thu Aug 12, 2010 4:27 pm

creating directories help

Post by daxguy »

I am trying to create a no of directories but the code is giving the following error

Warning: mkdir() [function.mkdir]: Invalid argument in C:\xampp\htdocs\gl\movie_process.php on line 174

the code is

Code: Select all

for(i=0; i=5 i++)
{
                     $base_folder = "{$base}uploads/movies/{$year}/{$month}/{$title}/";
			$path = $base_folder.$hosting[$i];
          							mkdir($path);
}
please help anyone?
Jsphlane20
Forum Newbie
Posts: 17
Joined: Wed Aug 11, 2010 1:17 pm
Contact:

Re: creating directories help

Post by Jsphlane20 »

I see several syntax errors with your code. Your for loop should look something like this

Code: Select all

for($i=0; $i<=5; $i++){

}
Also Echo out the $path variable and see what it displays for the value. It could be incorrect syntax for creating a directory.
Post Reply