note 36427 added to ref.ftp
| From: | www at w8c dot com | Date: | Thu, 09 Oct 2003 07:48:49 +0000 |
| Subject: | note 36427 added to ref.ftp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58092@lists.php.net to get a copy of this message | ||
$conn=@ftp_connect($ftp_server,"21");
$login=@ftp_login($conn,$ftp_name,$ftp_pass);
// copy dir
ftp_copy($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_copy($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;
}
----
Manual Page -- http://www.php.net/manual/en/ref.ftp.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36427
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36427&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36427&report=yes
Search -- http://master.php.net/manage/user-notes.php