HTMLフォームの入力値に基づいた名前で、PHPを使用してフォルダを作成したいと考えています。
μy html コードは次のとおりです。
<input name="foldername" id="foldername" >
私が持っているPHPは次のとおりですが:
if (isset($_POST['createDir'])) {
//get value of inputfield
$dir = $_POST['dirname'];
//set the target path ??
$targetfilename = PATH . '/' . $dir;
if (!file_exists($dir)) {
mkdir($dir); //create the directory
chmod($targetfilename, 0777); //make it writable
}
}
私のコードは機能していないようです。私は何を間違っていますか?