Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Speeedfire

    félisten

    válasz Tele von Zsinór #6250 üzenetére

    Hát nekem egyelőre úgy néz ki még ez is nagy falat. :O

    <?php

    $domd = new DOMDocument();
    libxml_use_internal_errors(true);
    $domd->loadHTML(file_get_contents("http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/"));
    libxml_use_internal_errors(false);

    $domx = new DOMXPath($domd);
    $links = $domx->query(sprintf("//a[position() >= %d]", isset($_GET["start"]) ? (int)$_GET["start"] : 0));

    $n = $_GET['start'];
    $m = $n+100;

    echo $n;

    for ($n; $n<$m; $n++) {

    $file = 'http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/';
    $file .= $links->getAttribute("href");
    $newfile = '../packages/' . $links[$n]->getAttribute("href");

    if (!copy($file,$newfile)) {
    echo 'Nem sikerült a(z) '.$n.' másolása.';
    }
    else {
    echo $n.'. Ok.';
    }
    }

    $uri = $_SERVER['PHP_SELF'].'/?='.$_GET['start']+100;

    header("Location: $uri");

    ?>

    Fatal error: Call to undefined method DOMNodeList::getAttribute() in /var/www/szunyi.com/openwrt/www/admin/masol.php on line 19

    Lehet tényleg jobban járnék valami ajaxos megoldással...

Új hozzászólás Aktív témák