note 63639 deleted from ref.ssh2 by bjori

From: Date: Mon, 27 Mar 2006 00:07:52 +0000
Subject: note 63639 deleted from ref.ssh2 by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106689@lists.php.net to get a copy of this message
Note Submitter: Mike <esnik8202 at sneakemail dot com> Reason: bad code ---- To slightly correct the directory listing code below.... <?php $connection = ssh2_connect("hostname", 22); // use any of the ssh2_auth_* methods ssh2_auth_password($connection,"username", "password"); $sftp = ssh2_sftp($connection); $dir = "ssh2.sftp://$sftp/path/to/dir/"; $dh = opendir($dir); while ($file = readdir($dh)) { echo "$file is in hostname:/path/to/dir\ n"; } closedir($dh); ?> (thanks to Sara for assisting)

« previous php.notes (#106689) next »