// PEAR::Net_FTP require_once 'Net/FTP.php';
// Configuration section $ftp[hostname] = "localhost"; $ftp[user] = "username"; $ftp[password] = "password";
// Create a new ftp class $ftp = new Net_FTP();
// Time to connect to the ftp server
$ftp->setHostname($ftp[hostname]);
$ftp->setPort(21);
$ftp->connect();
$ftp->setUsername($ftp[user]);
$ftp->setPassword($ftp[password]);
if(!$ftp->login()){
echo "Unable to connect to the $ftp[hostname] server. Please verify your settings and try again.<br>";
}
$ftp->pwd();
// Lets see what we can see. $ftpLS = $ftp->ls(null, NET_FTP_DIRS_ONLY);
echo "<pre>"; print_r($ftpLS); echo "<pre>"; $ftp->disconnect();
I get a error message back saying it could not retrieve current directory.
Can anyone offer any help? Example code would be appreciated. Thanks
Chris
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php