Php and FTP
Posted: Sun May 19, 2002 2:28 pm
My current project is making a FTP client in PHP. I read up on the functions in the manual, and whatnot. I can connect to an FTP, i dont get any errors doing so. But the problem is when i try to get PHP to list the directory, nothing shows up.
Heres my code
And also i did enable FTP in php.ini
Heres my code
Code: Select all
<?php
$connect = ftp_connect( $_POSTї'server'], $_POSTї'port'] );
if( !$connect )
{
echo"Couldnt connect to the server: $server";
exit;
}
$login = ftp_login($connect, $_POSTї'user'], $_POSTї'pass']);
if( !$login )
{
echo"Invalid Login Info";
exit;
}
$dir = ftp_pwd($connect);
$list=Array();
$list=ftp_nlist($connect, "$dir");
$i=0;
do{
echo $listї$i];
$i++;
}while($listї$i]);
?>