title: creating a new folder using PHP with custom name
body: <p>i have used this code to create new folder how can i create new folder with a name form client input and i get error in line six</p>
  
  <pre><code>Warning: mkdir() [function.mkdir]: File exists in /home/a3629462/public_html/123.php on line 6
  </code></pre>
  
  <p>that's the error am getting in line 6</p>
  
  <pre><code>$file_path = "uploads/";
  $new_name = ""; // this is the new folder you'll create
  $file_path .= $new_name . '/';
  mkdir($file_path);
  chmod($file_path, 0777);
  
  $file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
  if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
      echo "success";
  } else{
      echo "fail";
  }
  </code></pre>
  
  <p>this the HTML form i used i need to create folder name with input text entered in caption box</p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data" name="addroom"&gt;
   Select Image: &lt;br /&gt;
   &lt;input type="file" name="uploaded_file" class="ed"&gt;&lt;br /&gt;
  Caption&lt;br /&gt;
  &lt;input name="caption" type="text" class="ed" id="brnu" /&gt;
  &lt;br /&gt;
  &lt;input type="submit" name="Submit" value="Upload" id="button1" /&gt;
  &lt;/form&gt;
  </code></pre>