Autor Zpráva
VladimirV
Profil *
Mám hosting na savana.cz a bohužel mají zakázaný curl nebo file_get_contents. Potřebují načíst XML z URL adresy, abych xml mohl zpracovávat. To samé potřebuji u obrázku ... načíst ho z URL a uložit + použít.

Nevíte jaký script pro načtení z URL použít?
Lamicz
Profil
Co třeba fsockopen?
VladimirV
Profil *
S tím se moc nepohnu dál. Napíše mě to chybu:
Warning: fsockopen() [function.fsockopen]: unable to connect to http://example.cz/testovaci.php?id=34344sda4:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /mnt/data/accounts/i/ivanvilim/data/www/webwebweb/cron/import.php on line 31
Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? (154965536)

Script k tomu používám:
$fp = fsockopen("http://example.cz/testovaci.php?id=34344sda4", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: http://example.cz/testovaci.php?id=34344sda4\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        $xml_url = fgets($fp, 128);
    }
    fclose($fp);
}
 
$xml = simplexml_load_string($xml_url);

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0