test

XML; curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlBody); // Exécution $response = curl_exec($ch); if (curl_errno($ch)) { echo "Erreur WebDAV : " . curl_error($ch); curl_close($ch); return; } curl_close($ch); // Affiche le XML pour vérifier (à commenter après tests) # echo "
" . htmlspecialchars($response) . "
"; // Analyse XML $xml = simplexml_load_string($response); if (!$xml) { echo "Erreur lors du chargement XML."; return; } $xml->registerXPathNamespace('d', 'DAV:'); $items = $xml->xpath('//d:response'); // Affichage HTML echo "
    "; foreach ($items as $item) { $hrefNodes = $item->xpath('d:href'); if (empty($hrefNodes)) continue; $href = urldecode((string)$hrefNodes[0]); // Ignore le dossier parent (racine) $parsedBase = parse_url($webdavUrl, PHP_URL_PATH); if (rtrim($href, '/') === rtrim($parsedBase, '/')) { continue; } $name = basename($href); $fullUrl = $webdavUrl . rawurlencode($name); echo "
  • $name
  • "; } echo "
"; ?>

testmodule

Aucun fichier trouvé dans ce dossier.

Bienvenue sur l'Extranet