I think this may sound very straight forward, but still something is not working out. I am trying to create a folder with the name which is posted by the user and create a folder in the same directory. But I am not able to create one.
Here is my code:
$Name = $_POST['name'];
$thisdir = getcwd();
$folderPath = $thisdir . '\\' . $Name;
mkdir($folderPath);
chmod($folderPath, 0777);
What can be the problem, where am I making mistake or is the problem lying with server settings. If so what should be done to change the PHP server settings
Thanks
I suggest the following:
Check that you are getting data from $_POST using 'name' as the key.
Use '/' instead of '\' in the file path
Check you have permissions to create the directory in the current working directory (YOU may have, but does the webserver?)