I'm trying to have PHP make directories in another site via the use of the FTP functions. However, when I try to do so, I get the following errors:

Warning: ftp_mkdir() [function.ftp-mkdir]: store: Permission denied in /home/dir.php on line 85

Warning: ftp_chdir() [function.ftp-chdir]: store: No such file or directory in /home/dir.php on line 86

But I don't understand why I wouldn't have permission because if I open an ftp client and login with the same information, I can make all the folders I want. And even the folder I'm trying to write into right now is CHMOD 777. Any possible reason why it isn't working?

    Do you validate the success of your ftp_connect() and ftp_login() calls before trying to do the ftp_mkdir(), or just assume they worked? (I.e.: maybe you should show us your code?)

      yes they do successfully connect.

      	            $fconnect = ftp_connect($hostname);
      
                  ftp_pasv($fconnect, true);
                  ftp_login($fconnect, $username, $password);
      
                  $save = explode("/", $save);
      
                  foreach ($save as $dir) {
                               if ($dir == '%') {
      		          ftp_mkdir($fconnect, $_GET['page']);
      		          ftp_chdir($fconnect, $_GET['page']);
      		        } else {
      		          if ($dir != '..') {
      		            ftp_mkdir($fconnect, $dir);
      		          }
      		          ftp_chdir($fconnect, $dir);
      		        }
      		      }
      		      
        Write a Reply...