Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    am3
    am3 is offline
    New to the CF scene
    Join Date
    Aug 2002
    Location
    NY, USA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mkdir() HELP HELP!

    HELP! HELP! HELP! HELP!

    I can't find a good CGI tutorial on mkdir's
    The ones I do find only show part of the code like:
    "mkdir($dir,0777)"
    THEY DON' SHOW what's before this (how to query it) or after the code (HOW TO finish the execution).

    I use PHP but the SAFE MODE is on so It's not working right.
    I downloaded CGI programs that mkdir's on my server but I can't under stand the code.

    Here is what I came up with to pars my own form query >>>>

    ########################################################
    $QueryString = $ENV{ 'QUERY_STRING' } ;

    @NameValuePairs = split (/&/, $QueryString, 1);

    $parent_dir = "/home/user/public_html/folder/";

    foreach $NameValue (@NameValuePairs)
    {
    ($Name, $Value) = split (/=/, $NameValue);
    $Value =~ tr/+/ /;
    mkdir($parent_dir$Value,0777) || die "Cannot mkdir newdir: $!";
    }
    ########################################################

    Can you help me out ser with a complete sample of a query to make a directory?
    Thanks!

    AlexMcleaniii@yahoo.com

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Brisbane, Australia
    Posts
    181
    Thanks
    1
    Thanked 0 Times in 0 Posts
    most likely your server has blocked you from making new directories (could be wrong though).


  •  

    Posting Permissions

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