Posted By

jackoder on 04/07/10


Tagged

php change permission directoy


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


Change Permissions of Remote Directories


 / Published in: PHP
 

Hello friends.

I've create this script for you to change directories permissions without connecting them via Ftp Prog.

Thanks.

En Yeni Oyunlar

  1. <code>
  2.  
  3. // Define variables
  4. $server = "abc.com" ;
  5. $user = "abcuser" ;
  6. $password = "abspass" ;
  7.  
  8. // Create Ftp Connection via FTP
  9. $connection = ftp_connect("$server");
  10.  
  11. // Login to your system
  12. ftp_login($connection, $user, $password);
  13.  
  14. // Create a directory
  15. ftp_mkdir($connection, dir/dir);
  16.  
  17. // Change permissions of created directory
  18. ftp_site($connection, 'CHMOD 777, dir/dir');
  19.  
  20. // Close FTP connection
  21. ftp_close($connection);
  22.  
  23. </code>
  24.  
  25. I hope it will be useful for your projects.

Report this snippet  

You need to login to post a comment.