note 72106 added to ref.ftp

From: Date: Wed, 03 Jan 2007 04:57:25 +0000
Subject: note 72106 added to ref.ftp
Groups: php.notes 
Request: Send a blank email to php-notes+get-121222@lists.php.net to get a copy of this message
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"; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 67.164.66.46 ---- Manual Page -- http://www.php.net/manual/en/ref.ftp.php Edit -- https://master.php.net/note/edit/72106 Del: integrated -- https://master.php.net/note/delete/72106/integrated Del: useless -- https://master.php.net/note/delete/72106/useless Del: bad code -- https://master.php.net/note/delete/72106/bad+code Del: spam -- https://master.php.net/note/delete/72106/spam Del: non-english -- https://master.php.net/note/delete/72106/non-english Del: in docs -- https://master.php.net/note/delete/72106/in+docs Del: other reasons-- https://master.php.net/note/delete/72106 Reject -- https://master.php.net/note/reject/72106 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121222) next »