PHP with FTP
| From: | _-=MealstroM=-_ | Date: | Mon, 06 Mar 2006 22:32:20 +0000 |
| Subject: | PHP with FTP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-231558@lists.php.net to get a copy of this message | ||
Hello php-general,
Hi. I ve got some trabl with this commands
ftp_pwd() and ftp_chdir()
They work correctly with some ftp servers,
but i ve got some problems with warftp server.
This server doesn't recognize them.
Here is my function
function engine($conn_id,$host_id)
{
if($conn_id==NULL){return NULL;}
$d_list=d_list($conn_id);
for($i=0;$i<count($d_list[1]);$i++)
{
if($d_list[0][$i]=='d')
{
ftp_chdir($conn_id, $d_list[1][$i]);
if(ftp_pwd($conn_id)!='/'){$path=ftp_pwd($conn_id)."/".engine($conn_id,$host_id);}
else {$path=ftp_pwd($conn_id).engine($conn_id,$host_id);};
engine_reg($path,$host_id);
ftp_cdup($conn_id);
}
else {
if(ftp_pwd($conn_id)!='/'){$path=ftp_pwd($conn_id)."/".$d_list[1][$i];}
else {$path=ftp_pwd($conn_id).$d_list[1][$i];}
engine_reg($path,$host_id);
};
// else echo ftp_pwd($conn_id)."/".$d_list[1][$i]."<br>";
}
return 1;
}
--
Best regards,
_-=MealstroM=-_ mailto:mealstrom@rilan.net.ua