Click to See Complete Forum and Search --> : create a new directory dynamically for image upload every month


roshanjameer
03-15-2007, 11:41 AM
hi,


i have a image uoload site.till now all the images are uploaded in single directory and the path will be stored in mysql table.i want to dynamically create a new directory every month for image upload.once the month is finished then create a new directory dynamically and upload all the images in that new directory.
any of your idea will be appreciated.

thanks
mrjameer

sitehatchery
03-15-2007, 12:32 PM
mkdir()

bokeh
03-15-2007, 01:27 PM
<?php

$ParentDirectory = './images/';

is_dir($ParentDirectory.($date = date('Y-m'))) or mkdir($ParentDirectory.$date);

?>