Change Permissions of Remote Directories


/ Published in: PHP
Save to your folder(s)

Hello friends.

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

Thanks.

[En Yeni Oyunlar](http://www.yeni-oyun.com)


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.