Hi, I can't seem to find the answer I'm looking for online (maybe keywords are too common?). Is my code only verifying whether my directory is created? Or is it actually validating? I need it to validate, but I'm unsure whether or not it's doing that.
$dirPath = $_POST['company'];
$result = mkdir($dirPath, 0755);
if ($result == 1) {
echo '<br/>'.$dirPath . " has been created".'<br/>';
} else {
echo '<br/>'.$dirPath . " has NOT been created".'<br/>';
}
Upon a second submission with the same company name and uploaded image, I get this error:
Warning: mkdir() [function.mkdir]: File exists in /home/***/***/***/formulaires/processForm-test.php on line 69
Line 69, is as you guessed, the other code above (minus the first line).
What am I doing wrong?