note 72106 deleted from ref.ftp by nlopess

From: Date: Wed, 03 Jan 2007 12:18:51 +0000
Subject: note 72106 deleted from ref.ftp by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121235@lists.php.net to get a copy of this message
Note Submitter: orijing at gmail dot com Reason: spam ---- I had to chmod every html file to 666 so I could update them with PHP. Regular chmod() didn't work so I resorted to FTP. I tried it with my server: http://originxt.com and it worked. I run PHP 5.2.0. <?php $ftp_server = "ftp.originxt.com"; $ftp_user = "origin"; $ftp_pass = "---"; // set up a connection or die $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); // try to login if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) { $arr = ftp_nlist($conn_id, "/public_html/data"); foreach($arr as $k=>$v) { ftp_site($conn_id, "CHMOD 0666 /public_html/data/$v"); } } else { echo "Couldn't connect as $ftp_user\n"; } ?>

« previous php.notes (#121235) next »