ftp類(example.php)
更新時(shí)間:2006年10月09日 00:00:00 作者:
flush();
$ftp_ini_datei = $argv[1];
require ('./ftp_class.php');
require ($ftp_ini_datei);
echo "\nCronjob started : ";
echo date("d.m.Y - H:i:s");
echo "\n";
$newftp = new myftp;
if(!$anonymous){
$result = $newftp->connect($host, $user, $password);
}else{
$result = $newftp->connect($host, "anonymous", "mymail@somewhere.com");
}
if (!$result){
$mydir = $newftp->changedir($remote_dir);
$mydir = $newftp->getdir();
$merkold_dir = getcwd();
chdir($local_dir);
$mylist = Array();
$mylist = $newftp->get_file_list($mydir);
for ($i=0; $i < sizeof($mylist); $i++)
{
$result = $newftp->get_file($mylist[$i], $mymode, $delete);
}
$result = $newftp->ftp_bye();
}else{
echo "----------------------------------\n";
echo "no connection established :( \n";
echo "----------------------------------\n";
}
echo "\n\nCronjob stopped : ";
echo date("d.m.Y - H:i:s");
echo "\n";
?>
相關(guān)文章
選擇PHP作為網(wǎng)站開(kāi)發(fā)語(yǔ)言的原因分享
如今大多數(shù)的編程語(yǔ)言都能夠有效的處理復(fù)雜的任務(wù),支持多種數(shù)據(jù)庫(kù)并且兼容于多平臺(tái)。但是,當(dāng)一個(gè)網(wǎng)站選擇用何種語(yǔ)言開(kāi)發(fā)時(shí)應(yīng)當(dāng)更注重語(yǔ)言的成本和靈活性2012-01-01PHP中浮點(diǎn)數(shù)計(jì)算比較及取整不準(zhǔn)確的解決方法
這篇文章主要介紹了PHP 浮點(diǎn)數(shù)計(jì)算比較及取整不準(zhǔn)確的解決方法,需要的朋友可以參考下2015-01-01php中將指針移動(dòng)到數(shù)據(jù)集初始位置的實(shí)現(xiàn)代碼[mysql_data_seek]
在php中我們要返回?cái)?shù)據(jù)集初始位置mysql_data_seek函數(shù)即可實(shí)現(xiàn),下面看代碼2012-11-11