problem creating directories with chmodDirectory

kevin150

New Member
I have a script running on a staging site where it takes an uploaded image, creates a directory (if it exists) and uploads the image to said directory.I am trying to change the directory that gets created to the live site and having no luck. Pretty certain that it's this block of code that is still looking for the staging URL instead of the live.\[code\]function chmodDirectory( $path = '.', $level = 0 ){ $ignore = array( 'cgi-bin', '.', '..' ); $dh = @opendir( $path ); while( false !== ( $file = readdir( $dh ) ) ){ // Loop through the directory if( !in_array( $file, $ignore ) ){ if( is_dir( "$path/$file" ) ){ chmod("$path/$file",0777); chmodDirectory( "$path/$file", ($level+1)); } else { chmod("$path/$file",0777); // desired permission settings }//elseif }//if in array }//while closedir( $dh ); \[/code\]}//function?>Thanks in advance for any help!EDIT: The problem lies in that even though I've changed the paths and the database stores the correct URLs, the directory that i wish to be created or accessed is still being created / accessed on the staging directory.
 
Back
Top