This code was working some days ago... now I'm not sure what is going wrong.. Could someone shed a light or propose a better idea ?
<?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");
}
}
?>