Hey--
I had tried to use the FTP function before unsucessfully and now that I try it again, it works! (almost...)
I directly copied someones code which was supposed to cure the problem that I had beforehand. However, I still get the same problem?
I connect fine, but when I try to get a directory listing(ftp_nlist()), I just get NULL as a reply.
<?php
$ftp_host = "localhost";
$ftp_user = "anonymous";
$ftp_password = "anonymous";
//Connect
echo "<br />Connecting to $ftp_host via FTP...";
$conn = ftp_connect($ftp_host);
$login = ftp_login($conn, $ftp_user, $ftp_password);
//
//Enable PASV ( Note: must be done after ftp_login() )
//
$mode = ftp_pasv($conn, TRUE);
//Login OK ?
if ((!$conn) || (!$login) || (!$mode)) {
die("FTP connection has failed !");
}
echo "<br />Login Ok.<br />";
$mode = ftp_pasv($conn, TRUE);
//
//Now run ftp_nlist()
//
$file_list = ftp_nlist($conn, "");
var_dump($contents);
//close
ftp_close($conn);
?>
Is what I'm using...