note 36417 deleted from function.ftp-fput by vincent
| From: | vincent@php.net | Date: | Thu, 09 Oct 2003 11:01:33 +0000 |
| Subject: | note 36417 deleted from function.ftp-fput by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58110@lists.php.net to get a copy of this message | ||
Note Submitter: www@w8c.com
----
$conn=@ftp_connect($ftp_server,"21");
$login=@ftp_login($conn,$ftp_name,$ftp_pass);
// copy dir
ftp_copys($conn,$source,$dest)
function ftp_copys($conn,$source,$dest)
{
ftp_mkdirs($conn,$dest);
$h=@dir($source);
while (@($entry=$h->read()) !== false)
{
if (($entry!=".")&&($entry!=".."))
{
if (is_dir("$source/$entry"))
ftp_copys($conn,"$source/$entry","$dest/$entry");
else
{
if (@ftp_put($conn,"$dest/$entry","$source/$entry",FTP_BINARY))
echo "<p>$dest/$entry OK";
}
}
}
$h->close();
return 1;
}