SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Create Folder if it doesnt exist.

    Hi All,
    I have been battling with this code for a few days.
    I know for a fact, the variables are working.
    Any idea why this is not creating a directory?

    PHP Code:
    if(!is_dir("../../uploads/schools/".$tsid."/corporateclients/".$corpid."/")) 
    {
    mkdir("../../uploads/schools/".$tsid."/corporateclients/".$corpid."/");


  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,191
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Try passing the "recursive" parameter. http://www.php.net/mkdir


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
  •