1. #1
    flufsor's Avatar
    Registered
    13/10/06
    Location
    Antwerpen
    Posts
    41
    iTrader
    0
    Mentioned
    0 Post(s)

    Question PHP/JS: mkdir met variable

    Hey,
    ik zou een mkdir met een variable wille hebben maar het lukt me nie zouden jullie is willen kijken.

    PHP Code:
    <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> 
      <label>hoe moet de album noemen 
      <input type="text" name="maakdir" id="textfield"> 
      </label> 
      <input name="check" type="hidden" id="check" value="1"> 
      <p> 
        <label> 
        <input type="submit" name="button" id="button" value="Submit"> 
        </label> 
      </p> 
    </form> 
    <?php 
    if (isset($_POST['check'])){ 
    $titel $_POST['maakdir']; 
    mkdir('albums'.DIRECTORY_SEPARATOR.'$titel'0775true);  
        } 
    ?>
    nu maakt hij wel de dir $titel aan maar dat is natuurlijk nie mijn bedoeling.
    no votes  

  2. #2
    Smoerf's Avatar
    Registered
    28/07/04
    Location
    Wevelgem
    Posts
    552
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    0/0
    PHP Code:
    mkdir('albums' DIRECTORY_SEPARATOR $titel0775true); 
    en op je $titel doe je best nog wat checks, want niet alle chars zijn toegestaan voor directorynamen...
    no votes  

  3. #3
    BartDP's Avatar
    Registered
    02/10/05
    Location
    Elewijt
    Posts
    324
    iTrader
    14 (100%)
    Mentioned
    0 Post(s)
    Reputation
    0/0
    heb je wel genoeg rechten gegeven zodat php die directory kan aanmaken??

    edit: nvm examestress
    no votes  

Posting Permissions

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

Log in

Log in