SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MkDir PHP problem

    I have a simple mkdir script, that creates a directory that contains 3 sub-fodlers, on my server.

    The script works fine on my Apache server and if the directory exists, the error message is displayed.

    However on my IIS, I get an HTTP error, I don't think that the script is getting to the "if" or "else" functions :

    HTML Code:
    PHP Warning: mkdir() [function.mkdir]: File exists  in C:\Web\QT\admin\script.php on line 85
    PHP Code:
    // URL
    $url "//Server/Folder1/Folder2/";

    // Create It
    $create mkdir("$url");
    mkdir("$url/Sub1");
    mkdir("$url/Sub2");
    mkdir("$url/Sub3");

    if (
    $create) {
      
    $mess $ref $_SERVER['HTTP_REFERER']; header'refresh: 0; url='.$ref);;
      
    $query sprintf("UPDATE tbl_freelancer SET freedir='y' WHERE freeid=%s"GetSQLValueString($colname_rsFreelance_Dir"int"));
      
    $result mysql_query($query$conndb2) or die(mysql_error());
    }
    else {
      
    $mess "<p>Directory could not be created.</p>";

    Is there a way of getting this to work?

  2. #2
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very confusing bit of code...

    try folder recursion and state folder path not url!!

    might want to explode path on '/' and recursivly make them...

  3. #3
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi lemonzoo,
    Sorry, I'm very new to this, so could you give me an example of what it should look like?
    Many thanks


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
  •