这段代码几天前就开始工作......现在我不确定会出现什么问题。有人可以提出建议或提出更好的建议吗?
<?php
$album = $_POST['name'];
function create_album($album){
$albumPath = "albums/".$album;
if (is_dir($albumPath)){
echo('Album already exists.');
}
else{
mkdir($albumPath);
echo ("The album $album was created successfully");
}
}
?>
答案 0 :(得分:0)
您缺少对该功能的调用。
<?php
$album = $_POST['name'];
function create_album($album){
$albumPath = "albums/".$album;
if (is_dir($albumPath)){
echo('Album already exists.');
}
else{
mkdir($albumPath);
echo ("The album $album was created successfully");
}
}
create_album($album);
?>