Viewing file: bajar_libros.php (1.63 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php require "../frames/class.ftp.php"; include "../frames/conn.php";
$ftp_server = "62.193.202.9"; // add server name $ftp_user_name = "gp571133"; // add user name $ftp_user_pass = "j41ondtj"; // add password $dst_dir = "web/extras/fb2/"; // add destination directory ( www/upload/ )
$counter=0; $limite=1000;
$sql="select id from libros order by id limit $limite"; $res=mysql_query($sql,$conn); $ftp = new ftp($ftp_server,$ftp_user_name,$ftp_user_pass,$dst_dir); while ($row=mysql_fetch_array($res)){ $ultimoid=$row['id']+1; } echo $ultimoid; $sqlletras="select * from letras where letra > 'S'"; $resletras=mysql_query($sqlletras,$conn); echo mysql_error(); $counter++; while ($rowletras=mysql_fetch_array($resletras)){ // mkdir("./{$rowletras['letra']}", 0777); $sql="select REPLACE(ruta, 'http://www.cocido-maragato.com/extras/fb2/', '') as titulo, id from libros where autor like '{$rowletras['letra']}%' and id <$ultimoid "; echo $sql."<br>"; flush(); // die(); $res=mysql_query($sql,$conn); while($row9=mysql_fetch_array($res)){ //class constructor $archivo_remoto=$row9['titulo']; $archivo_local="./{$rowletras['letra']}/{$archivo_remoto}"; echo $counter."<br>"; echo $archivo_remoto."<br>"; echo $archivo_local."<br>"; $counter++; $ftp->getfile($archivo_local,$archivo_remoto); //$ftp = new ftp($ftp_server,$ftp_user_name,$ftp_user_pass,$dst_dir); } } $ftp->disconnect();
?>
|