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
Warning: mkdir() [function.mkdir]: File exists in /home/a3629462/public_html/123.php on line 6
that's the error am getting in line 6
$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";
}
this the HTML form i used i need to create folder name with input text entered in caption box
<form action="" method="post" enctype="multipart/form-data" name="addroom">
Select Image: <br />
<input type="file" name="uploaded_file" class="ed"><br />
Caption<br />
<input name="caption" type="text" class="ed" id="brnu" />
<br />
<input type="submit" name="Submit" value="Upload" id="button1" />
</form>