I am completely new to mkdir, and i can't seem to get it to work, so I'm hoping someone will suggest things I might try:
I am using chronoforms V4 and a custom code block to run a bit of code (This isn't really a chronoforms question, but I'll try to push my luck anyway as you're a smart bunch on here)
I am trying this:
to see if my nkdir is working (and it aint!)
I am getting as a response:
So, I have checked the obvious:
The folder is not being made
$form->data['shortname'] is getting the appropriate value from the form
echo dirname( __FILE__ ); shows I'm 4 directories up from where I want to be
../../../../sites/frecol is the path to the directory I want to create ('host' is my site root folder, host/sites/ already exists and is 0777 )
The error message I get from my hosting console is
I wonder...
Can I move up the folders like that? ../../ ? I know the path should be relative so I'm assuming using jhtml to get the site root will not work
Is there something else, permissions-wise that I'm unaware of?
If you have things I can try or places to look for more clues about why it's failing, then please chip in.
Many thanks
Andy
I am using chronoforms V4 and a custom code block to run a bit of code (This isn't really a chronoforms question, but I'll try to push my luck anyway as you're a smart bunch on here)
I am trying this:
$schdir = "../../../../sites/" . $form->data['shortname'];
if (mkdir($schdir, 0777)) {
echo "Made"; } else { echo "Not made"; }
echo dirname( __FILE__ );
echo "<br/>" . $schdir;
die();
to see if my nkdir is working (and it aint!)
I am getting as a response:
Not made
/home/sites/websitesfast.co.uk/public_html/host/administrator/components/com_chronoforms/form_actions/custom_code
../../../../sites/frecol
So, I have checked the obvious:
The folder is not being made
$form->data['shortname'] is getting the appropriate value from the form
echo dirname( __FILE__ ); shows I'm 4 directories up from where I want to be
../../../../sites/frecol is the path to the directory I want to create ('host' is my site root folder, host/sites/ already exists and is 0777 )
The error message I get from my hosting console is
[Sat Aug 20 15:45:09 2011] [error] [client 158.94.64.113] PHP Warning: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in /home/sites/websitesfast.co.uk/public_html/host/administrator/components/com_chronoforms/form_actions/custom_code/custom_code.php(17) : eval()'d code on line 3, referer: http://www.websitesfast.co.uk/host/index.php?option=com_chronoforms&chronoform=schoolmaster_signup
I wonder...
Can I move up the folders like that? ../../ ? I know the path should be relative so I'm assuming using jhtml to get the site root will not work
Is there something else, permissions-wise that I'm unaware of?
If you have things I can try or places to look for more clues about why it's failing, then please chip in.
Many thanks
Andy