I have added some PHP code to create a folder at the root of my website when a new user is registered.
I have create an action "Custom code" on the event "On Submit" but it fail every times.
Here is the code that I have added, it's just a mkdir:
<?php
echo 'DOMAINE: '.$form->domain.'<br />';
if(!is_dir('/'.$form->username.'/')){
echo "-----------MKDIR-----------<br/>";
if (!mkdir('/'.$form->username.'/',0777)){
echo"CREATE FOLDER IMPOSSIBLE !<br/>";
}else{
echo"CREATE FOLDER SUCCESSFULLY !<br/>";
}
}
?>
I have tried with mode "View" and mode "Controller" but always the same error.
Here is the error I have:
Warning: mkdir() [function.mkdir]: Permission denied in /administrator/components/com_chronoforms/form_actions/custom_code/cfaction_custom_code.php(14) : eval()'d code on line 6
CREATE FOLDER IMPOSSIBLE !
But I a trying to create the folder at the root and not in the folder specified in the error message. And I have the rights 755 on this folder. I have tried with permissions 777, it doesn't work neither.
Thanks in advance for your help.
Kind regardss,
Kevin