#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Pune, Maharashtra, India
    Posts
    86
    Rep Power
    15
    I want to mak a php script that checks if a particular directory exist then just proceed without giving any error to check if the directory contains two sub-directory with names abc and bcd if No then creates the directory. How to do this. Want help at the earliest Please.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    France
    Posts
    16
    Rep Power
    0
    Hi,

    Try this:

    <?

    if (is_dir($dirname)) { // True if exists and is dir
    if (!is_dir($subdir1)) // $subdir= absolute path
    mkdir($subdir1); // create $subdir1
    if (!is_dir($subdir2)) // $subdir= absolute path
    mkdir($subdir2);

    }

    ?>

    Hth


    JBL

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 10:45 PM
  2. How to check how many users are connected in php
    By chandar in forum PHP Development
    Replies: 1
    Last Post: January 29th, 2004, 09:30 AM
  3. PHP users group
    By rec in forum Flash Help
    Replies: 2
    Last Post: January 28th, 2004, 07:32 PM
  4. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo