Results 1 to 3 of 3

Thread: Why mkdir() function not working

  1. #1
    Join Date
    Apr 2009
    Posts
    45
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default Why mkdir() function not working

    Hello Dear Friend,

    here i get that error

    Code:
    Warning: mkdir() [function.mkdir]: No such file or directory in /hermes/web08/b1256/moo.faridaed/common/common.php on line 389
    and here is the common.php code

    Code:
    // create writable directory or change the chmod permission of chosen directory
    function check_dir($dir) {
    
    	if (!file_exists($dir)) {
    		 if (mkdir($dir, 0777))// create images dir
    			$done = true;
    
    	} else if (!is_writeable($dir)) {
    		if (chmod($dir, 0777)) // change perm. setting
    			$done = true;
    
    	} else
    		$done = true;
    
    	return $done;
    }
    it should create a file where an images will goes
    at following path products/images/
    i've giveen /products/ and /images/ CHMOOD 777
    and still getting the error :chomp:

    thanks so much for helping me
    Last edited by egturnkey; 09-01-2009 at 12:11 AM. Reason: thanks for help

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    The only thing I could think of is that the $dir path is not being set correctly. You could try echoing the $dir variable inside the function or send an absolute path to the function.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. The Following User Says Thank You to thetestingsite For This Useful Post:

    egturnkey (09-01-2009)

  4. #3
    Join Date
    Apr 2009
    Posts
    45
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default

    thanks you7 guys, it has been solved

    yes i don't know WHY ?? but as soon as i changed the Database with new one , it did works so this mean that the error was due to the database cause it should create a dir that has the same ID of the product i've added

    hence it turn to be that i made an error in writting the database tables

    thanks for you all for support

    thread to be closed

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •